657,358 questions
Score of 0
0 answers
33 views
How to design a zero-downtime schema migration strategy for a high-traffic Laravel/MySQL application with hundred of millions rows?
I am designing a Laravel application that handles millions of daily requests with a MySQL database containing tables with hundreds of millions of rows.
A common requirement is adding or modifying ...
Score of 0
0 answers
39 views
Dealing with lookup tables and enums between database and spring app
I am attempting to add an enum of Roles for users. I have a roles table that then has a FK constraint to a roles_name table for the role name. My question is how do I deal with the roles as an enum ...
Advice
0
votes
6
replies
184
views
Concat multiple row values into for a single empId
Like I have user Data 50 emp inside each user has different skills 3 rows same user but skill column value is different
I want to concat the skill and display in single row for each user don't want ...
Score of -3
0 answers
71 views
Find the number that appears most often, considering 2 columns [duplicate]
Question from LeetCode SQL #602 using MySQL
https://leetcode.com/problems/friend-requests-ii-who-has-the-most-friends/?envType=problem-list-v2&envId=m8baczxh
My code:
# Write your MySQL query ...
Score of 1
3 answers
158 views
Index being ignored when filtering and ordering by different columns?
I have a MySQL table with about 5 million rows:
CREATE TABLE orders (
id BIGINT PRIMARY KEY,
customer_id BIGINT NOT NULL,
status VARCHAR(20) NOT NULL,
created_at DATETIME NOT NULL,
...
Best practices
3
votes
7
replies
276
views
PHP MYSQL Login Form, is there a better way to do it?
I am currently learning PHP and trying to follow good practices regarding login handling, sessions, input validation, and database access.
I wrote the following login script and added detailed ...
Advice
1
vote
7
replies
165
views
Use INNER JOIN or Sub-queries in a more efficient way
Products:
ProductID
ProductName
1
Product1
2
Product2
Tags:
TagID
TagName
1
Tag1
2
Tag2
ProductTags (Bridge table between Products and Tags):
ProductID
TagID
1
2
1
2
ProductVariants:
VariantID
...
Advice
0
votes
3
replies
77
views
How long can a master-master replication be disconnected? Are there settings for this?
The question is pretty much it.
I have a database that serves two quite far apart campuses.
It turns out that the remote campus has a sketchy network connection and can drop for up to one hour.
Can ...
Score of 2
1 answer
146 views
Custom ID Generator in Hibernate 6: Use existing ID or fall back to auto-increment
I'm upgrading my application to Java 21 and Spring Boot 3.5.x, which brought in Hibernate 6 as a dependency. As part of this upgrade, my existing custom ID generator broke and I need to rewrite it to ...
Best practices
2
votes
7
replies
271
views
How can I improve my ability in writing SQL?
I am new to SQL and overwhelmed with tons of information and don't know where to start.
Is learning from video instruction good enough?
How can I make my learning experience more fun?
How long does ...
Score of 1
1 answer
136 views
MySQL Case Function
What is wrong with my query?
CREATE PROCEDURE process_flight_log_staging_doug()
BEGIN
UPDATE `flight_log_staging_emt` SET `off_z` =
CASE 'offz'
WHEN `off_tz`='EDT' THEN `off_lcl`+INTERVAL 4 HOUR
...
Score of 0
1 answer
157 views
JOINING three tables using subquery with MAX date [duplicate]
I have three tables, orders, invoices and invoice lines.
uid OrderNumber product_id product_name quantityOnOrder
1 101 p001 Apple 6
2 102 p002 ...
Advice
0
votes
0
replies
57
views
Best practices for JPA Entity ID generation (IDENTITY vs SEQUENCE) in OceanBase MySQL mode?
We are migrating a Spring Boot 3.x application (using Hibernate 6) from a standalone MySQL instance to an OceanBase cluster (v4.x) running in MySQL-compatible mode.
Currently, all our JPA entities are ...
Tooling
1
vote
1
replies
103
views
What is the best practice to implement authentication for a web app built with nuxt frontend, .NET backend, and MySQL database?
Currently in the architecture building phase of developing a web application. As the question states, front end will be built with Nuxt and hosted on vercel. Images, generated pdfs (part of the app's ...
Best practices
0
votes
3
replies
104
views
Java Spring MySql8 thread safe select then delete
I'm working on a Java Spring boot app hosted on EKS. The app is running on loads of pods, assume 100s. The app is connected to an Aurora MySql8 Database. I need to run a job on a schedule that ...