All Questions
3,111
questions
-1
votes
0
answers
26
views
Real estate database design to save listings of different types [duplicate]
I am creating a website similar to this website. My website needs to allow users to save different kinds of listing like home, plots. offices, shops, agricultural land etc. My question is how to ...
0
votes
0
answers
60
views
SQLite Strict Mode or any other alternatives
I am currently developing a QT C++ Application for my friend's shop. Simple application for inventory management and billing system. So, the DB will be in his computer itself which also hosts the ...
2
votes
1
answer
74
views
how can i calculate mutual friends/followers efficiently?
i need to calculate mutual friends between users, right now it is working fine, but i don't think it will work for users who have a large follower base, it will take a long to load and compare. please ...
-2
votes
2
answers
56
views
How to delete only orphan child rows with ON DELETE?
I have a parent table and a child table. A parent row stores the foreign key to the child row. If I set the constraint on the foreign key to ON DELETE CASCADE then that will throw an error when I want ...
0
votes
1
answer
47
views
"Using index condition; Using where" explaining my query, with proper indexes?
From the manual Using index condition; Using where:
By accessing index tuples and testing them initially, tables can be
read while deferring the reading of full rows until it is essential.
I've the ...
0
votes
1
answer
97
views
Many-to-many relationship database design [duplicate]
I am setting up new MySQL database schema for a small company. We sell products which are collections of raw units of inventory. In the database, I would like to link products with their raw inventory ...
0
votes
1
answer
55
views
How can i make a primary key chose the table to link to between two tables (specifically where the primary key exists)? [duplicate]
I have three tables of concern to my problem: students, staff, and issued_books. The issued_books table has book_id column (reference to the books table) and user_id column (reference to either ...
-1
votes
2
answers
70
views
Which one is better: in database?
I am working on a system using JPA where Entity 'Events' are associated with Entity 'Groups' and each Group has fields (Group1, Group2...) indicating their attendance status for an event.
How to ...
0
votes
1
answer
33
views
Best way to handle page numbers in MySQL bibliography?
I’m trying to work out the structure for a bibliography database with three basic entities: text (essays, articles, etc.), publication (the books, journals, etc. that contain those texts), and maker (...
-1
votes
1
answer
27
views
Table 'shopping_cart', which contains 2 foreign key as primary key and other foreign key, have an error with relationship while importing data
While importing data, I have
Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails (`mydb_innodb`.`shopping_cart`, CONSTRAINT `fk_shopping_cart_order_payment1` FOREIGN KEY ...
-2
votes
2
answers
268
views
Difference between entity and relation in UML and SQL
Just wanted to make sure that I'm understanding this right:
designing UML-diagram we are talking about the relations between entities?
in the context of SQL a table is a relation?
I can remember ...
-1
votes
2
answers
33
views
why this query always return that the table is booked?
drop procedure if exists AddValidBooking;
DELIMITER //
CREATE PROCEDURE AddValidBooking(IN booking_date DATE, IN table_number INT)
BEGIN
DECLARE booked BOOLEAN;
START TRANSACTION;
...
-1
votes
2
answers
106
views
Is it sensible to create a different table for the same data for each date?
I have a MYSQL InnoDB table table with the following columns (table and column names changed):
date (PK, DATE)
var_a (PK, FK, INT)
var_b (PK, FK, INT)
rel_ab (DECIMAL)
where rel_ab is a column that ...
-2
votes
1
answer
902
views
product variations table for ecommerce
i am working on an ecommerce tables
and i came across variations where i didn't know how should it done
lets assume those are my mysql tables
my question is for example
I phone 14 pro max
have ...
-3
votes
1
answer
41
views
Should I create 3 fields or create one 1-to-many relationship?
I have a table called query where medical data such as medicine are stored, in the form I have up to 3 fields of medicines. In the table I must create these 3 fields or I create another table called ...