All Questions
964
questions
0
votes
1
answer
35
views
Dependency Cycle in Database with Update Approvals
I'm struggling with a dependency cycle in my SQL database schema for a system with update approvals. Here's the situation:
I have tables for documents , transactions, payment_methods, and ...
-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 ...
-1
votes
1
answer
36
views
How to prevent room-switching if you assign a room type to a customer in a Hotel booking database?
It would be much easier to assign a room number to a guest at the time of reservation but this can lose business.
The alternative is to instead assign a room-type to a guest at the time of reservation ...
0
votes
1
answer
191
views
design database for dictionary application
I'm trying to make a dictionary application but having a hard time designing my sql database (I'm very new to databases).
Here's the problem:
I want to store entries, entires can be words or sentences....
-1
votes
1
answer
98
views
Redundant relation: Is this a violation of database normalization?
I have a table with products that I offer. For each product ever sold, an entry is created in the ProductInstance table. This refers to this instance of the product and contains information such as ...
0
votes
1
answer
65
views
In an organization's database, should there be separate department and job tables?
I am creating the backend of a microservice
that will serve as a tool to see in real time how the company's employees are distributed by projects and what days they have assigned to each one.
The ...
0
votes
1
answer
143
views
Is it bad practice to store a foreign key like user_id in all related model tables even if some of those models are children of related models?
We have 3 models: Users which can have Orders which can have a Transaction (like a credit card transaction).
Does it make sense to store the user_id on transactions or is that considered bad practice ...
-2
votes
1
answer
523
views
Vaccination Database design ERD
My intentions to design the database schema for the small pet vaccination application.
Inside Pet table I want to store details about the pets and if specific vaccination is required.
There are 3-4 ...
0
votes
0
answers
108
views
How to normalize the null column? [duplicate]
I have object
{
totalPrice : 20,
totalCost : 15,
invoice:{ [ { price : 10, name : "microphone" }, { price : 10, name : "speaker" } ] },
order: { [ { price : 10, ...
-3
votes
1
answer
458
views
Db design relationship between n:n tables?
I have poor skills for db design and I need some help about relations setup.
So use case is:
User which can be Coach or Client.
Client can have many coaches and coaches can have many clients.
Coach ...
-2
votes
1
answer
66
views
Database design - Storing keys to all required information vs performing Joins when authorizing access [duplicate]
Take the following examples (Only pseudocode) when considering whether a "Company" has access to see information about a "ClientSale". Either I can store the FK references to ...
-3
votes
1
answer
545
views
Splitting database table for performance?
I have one MySQL innodb table storing data for my web service that is heavily used. I am wondering if splitting it into two tables(with identical schema) and having my web service balance load between ...
0
votes
1
answer
531
views
Handling inherited and not inherited values in PostgreSQL
I'm trying to draw database schema and struggling with inheritance. Let me tell with an example:
I have tables List and Item:
Table List{
id varchar [not null, pk]
parent_list_id varchar [ref: - ...
0
votes
2
answers
298
views
Preserve data integrity in a database structure with two paths of association
I have this situation that is as simple as it is annoying.
The requirements are
Every item must have an associated category.
Every item MAY be included in a set.
Sets must be composed of items of ...
-1
votes
1
answer
42
views
How to add x amount of employees to a stationlog?
I have an ERD.
The Stationlog table logs which employee worked at the station and at what time the employee logged in and out. The station produces orders.
As of now there can only be 1 employee ...