Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [mysql]

MySQL is an open-source, relational database management system.

0 votes
3 answers
139 views

.Net 8 XUnit: How to mock MySql in a CQRS API using integration tests?

This is a rewrite of my own .Net 8 XUnit: Should my tests use real data or how to mock MySql with CQRS? in a much more clear way: The reason for rewriting my previous question is because in the ...
Diego Perez's user avatar
3 votes
2 answers
359 views

.Net 8 XUnit: Should my tests use real data or how to mock MySql with CQRS?

I'm creating tests for our .Net 8 API. We use MySql for data storage and CQRS pattern for queries. In my personal opinion, I shouldn't use the real database for testing, because you will use an ...
Diego Perez's user avatar
1 vote
2 answers
104 views

Linking records through multiple tables?

I'm writing a game server. Similar to the Sims. Players can own furniture items they purchase from the catalog. There can also be rooms. Players can be in a room. A room can have furniture items of ...
VoiD HD's user avatar
  • 167
2 votes
1 answer
185 views

Designing a flexible and comprehensive restaurant menu database schema?

I am working on developing a MySQL database schema for a restaurant menu system inspired by platforms like DoorDash, UberEats, and Yelp. My aim is to design a schema that is flexible and can handle ...
tony's user avatar
  • 145
0 votes
1 answer
164 views

Our php codes base has 6 different ways to do INSERT … ON DUPLICATE KEY UPDATE, how do I fix it?

Our php codes base has 6 different ways to do INSERT … ON DUPLICATE KEY UPDATE. It happened over years because the php framework is evolving and my team members come and go, although I won't say we ...
Qiulang 邱朗's user avatar
-1 votes
2 answers
106 views

Best Practices for Storing Operational Hours Extending Past Midnight in MySQL

I'm building a PHP application to manage business operating hours, including cases where the closing time extends past midnight. I'm considering various ways to store these hours in MySQL and need ...
tony's user avatar
  • 145
0 votes
2 answers
394 views

Is it reliable to process millions of records with INSERT INTO SELECT directly in the database?

I have several million booking rows in a table and would now like to save the totals of the booking amounts in another table depending on the customer, account no., product, etc. Should this ...
root66's user avatar
  • 121
-2 votes
2 answers
200 views

Designing a database schema for a website related to my town's history

I am working on digitizing old photographs, articles, ephemera, etc. related to my town's history, and I've been tasked to put these scans I've made onto a website for the public to see. There are ...
EdmundF's user avatar
  • 13
2 votes
2 answers
161 views

Do we have 2 logical query processings, one with indexes and one without indexes?

In the book "Inside Microsoft® SQL Server® 2008: T-SQL Programming" the behaviour of a sql query is explained. The following picture is taken from the book. I have some questions about the ...
jwa's user avatar
  • 29
0 votes
2 answers
167 views

How to handle time differences in MySQL

I'm facing a problem with handling different timezones in MySQL. I have looked into similar questions that were previously raised, but I couldn't find a proper answer. The issue I'm encountering is as ...
Prasad Darshana's user avatar
3 votes
3 answers
191 views

How to reliably determine changes in a DB table since some sort of "checkpoint"?

My scenario is fairly typical, but I can't figure out a good solution. I have a DB table (in reality several unrelated tables, but let's focus on one) where there is a fair deal of activity going on. ...
Vilx-'s user avatar
  • 5,360
3 votes
2 answers
1k views

Is it a good practice to have two unique IDs for an SQL-Database?

Currently I want to create a SQL database effectively and "logically". Lately I read a lot about the issues that it is (mostly) not a good idea to define primary keys that can be seen from &...
Vito's user avatar
  • 65
15 votes
9 answers
9k views

Can it be acceptable to construct SQL queries dynamically?

I know that as a general rule, you shouldn't construct SQL queries dynamically because of the possibility of SQL injection. However, it could come in quite handy to break this rule and define for ...
Thomas's user avatar
  • 185
1 vote
2 answers
562 views

Is it a good idea to design a database based on the API response data types?

I am trying to design my database, where i have to save some response data given from an external api as a webhook. This api will return me as well “referenceId” as an identifier, which i will use ...
user avatar
9 votes
4 answers
4k views

How to store a fixed length array in a database

I have a mysql database in which I have drafts, each of which contains exactly 24 players the order of which matters. I am conflicted between having a drafts table with 24 extra columns for each ...
RobbyG's user avatar
  • 101

15 30 50 per page
1
2 3 4 5
36