All Questions
Tagged with database database-design
9,374
questions
1
vote
1
answer
98
views
How to implement a wide multi-level self-join PostgreSQL query?
I have several rows that represent a person. Each person has a column for bio_mother _uuid and a bio_father_uuid. I used this page (I mention that because it's referenced in this similar question) to ...
0
votes
0
answers
18
views
When an E-R attribute should be perceived as a relationship attribute or as an entity set attribute?
Aspects worth to consider from the very beginning:
In order to maintain the degree of simplicity of the problem this post presents, I haven't provided the exact requirement, on the basis of the ...
0
votes
1
answer
41
views
Can i create a table with 2 foreign keys? These 2 foreign keys are 2 primary keys of 2 different tables
I am planning to create a table with 2 foreign keys. These 2 foreign keys reference 2 primary keys of 2 different tables. However, one of the two foreign keys may be null due to business reasons. So ...
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 ...
1
vote
1
answer
75
views
Use conditional constraint or normalize table?
I have two entities: A and B. The latter has two types B1 and B2. Their relationship is:
(A,B1) is (1:1)
(A,B2) is (1,N)
When creating database tables, I wonder how is the best way to guarantee ...
0
votes
1
answer
54
views
Design SQL Schema for User Interests
I'm trying to find the best approach for designing sql schema for the following scenario:
-A User can have multiple interests
-The platform provides predefined interests from which the user can ...
0
votes
0
answers
59
views
How to assign multiple Foreign keys to one box in an sql table
I have created a database that has one table that keeps track of employee skills and another which displays projects that these employees can be assigned to.
I need to have multiple employees asigned ...
-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
0
answers
24
views
How to Handle Dynamic Priority Updates in Firestore [duplicate]
I'm managing a list of 10,000+ items in Firestore, each with a dynamic priority that frequently changes. Initially, I stored items in an array within a single document, but this approach struggles ...
0
votes
0
answers
99
views
Database Design for storing Key-Value Tags per Item
I want to build an online shop where the products don't follow a specific schema, so the attributes can be quite different for each product.
My idea is to allow the sellers to define custom tags with ...
-1
votes
1
answer
83
views
Separate tables based on business goals
Is it worth to split tables bases solely on the business goal?
NOTE: The tables all have identical columns.
1. One table
One orders table, with a orderType column to differentiate them.
2. Two tables
...
0
votes
1
answer
35
views
Database relationship PK table to PK, FK table
Database relationship PK to PK, FK
I have some tables in a database and I am trying to figure out the relationship between them,
Customer: PK CustomerID
Agents: PK AgentID
Listing: PK ListingID
...
0
votes
0
answers
70
views
Were the entity sets and their associated relationships accurately and properly constructed?
To be considered:
The bolded terms that appear across the requirement I laid out bellow are the ones included in the entity set (Vehicle) I created.
I also specified the attributes nature/kind/type.
...
0
votes
1
answer
119
views
Large store database design in Laravel
I have a Laravel store project that I am confused to develop my products database. My store products are clothes, shoes, pants, laptops, phones, headphones, etc.
Hello friends, good time
This database ...
0
votes
0
answers
53
views
In DynamoDB single-table design, should the shard lookup be in a separate table?
I'm trying to design a multi-tenant single-table in Dynamodb. My primary key needs to be the tenantId for all items so that I can enforce tenant isolation. The PK potentially faces hotkey issues due ...