All Questions
Tagged with database database-design
9,379
questions
0
votes
2
answers
2k
views
follower/following relationship
I understand how basic database relationships work but I am confused about the following/follower social media relationship in RDBMs.
Users table:
userId (PK)
email
name
Follow table:
...
1
vote
1
answer
36
views
Why is read repair not sufficient in making dynamo-style database linearizable?
I am reading DDIA. It says "possible to make Dynamo-style quorums linearizable at the cost of reduced performance: a reader must perform read repair (see “Read repair and antientropy” on page 178)...
0
votes
0
answers
29
views
Need to determine whether different question types for a questionnaire are many-to-many or one-to-many
We need to survey our contacts by asking them various questions and recording their responses. Some questions are standard and must be included in every survey (default questions), while others are ...
0
votes
0
answers
10
views
In a social media relational database schema, should I use separate tables for posts likes and comments likes?
I have a social media app with users, posts, and comments, in which users can like posts and comments.
Is it best practice to use the same table to store the likes of both, such as:
user_id
post_id
...
0
votes
3
answers
1k
views
Undo a SQL Query that is already been Executed
I am currently searching a query that can reform data back to its original form.
For example if I do the following query:
UPDATE Pupil
SET Telephone = '999'
WHERE Telephone = '0161'
I have done ...
0
votes
2
answers
10k
views
ER diagram for lab
Draw an ER diagram for the following situation: a lab has several
chemists who work on one or more projects. Chemists also may use
certain kinds of equipments on each project.
Attributes of Chemist ...
-3
votes
2
answers
54
views
one-to-one mandatory attendance relationship
As shown in the diagram, there are 2 tables with a one-to-one relationship and mandatory participation. Can you help me implement this as ddl code? I could do it easily when there was no mandatory ...
1
vote
1
answer
202
views
How can I add machines to data already been sharded in SQL database?
I have a lot of data of users. Each one has a unique user id which is represented by a base64 of six characters. for example (Fga6=gY).
I used a hash function to spread the users across my MySQL ...
6
votes
7
answers
3k
views
how to save marital relationship in a database
I have to save this information in a database
Person -> is married to -> Person
Where should I save that information? What is the proper design pattern should I apply here?
Thank you!
1
vote
2
answers
64
views
How to system-design paying a payment with multiple currencies
I am developing an accounting app where users can have a product with currency A. The value of the product can be escrowed using a cheque payment with currency B and this cheque payment can be paid in ...
-2
votes
1
answer
143
views
Wrestling simulator Entity Framework / database design
I'm struggling to come up with a database design.
Scenario: I'm creating a very basic wrestling simulator game.
I have the following model classes:
Wrestler
public class Wrestler
{
public int ...
-1
votes
1
answer
572
views
Creating a relationship with a calculated field
I am trying to create a relationship between 2 tables in Access. In one table I have customers, in another I have areas by postal region. In the customers table I have all the usual address ...
-1
votes
0
answers
30
views
Parent-Child relationships where parent and child tables may change based on settings
I am developing a Warehouse Management System. Each Warehouse can specify storage locations by varying degrees of specificity: Zone, Aisle, Row, Rack, Shelf, Bin. While Bin is always required because ...
-2
votes
0
answers
35
views
Normalized database structure would result in the lowest-level types containing huge amounts of data
I'm using Xano as my database management system.
Here’s how my website content is structured:
- Company (first level type)
-- Division (second level type)
--- Team (third level type)
---- Employee (...
2
votes
4
answers
937
views
Access: Composite Unique Index ignores NULLs
Consider this table structure:
CREATE TABLE [TableA]
(
[PK_ID] int NOT NULL PRIMARY KEY,
[Name] text NOT NULL,
[FK_TableB] int NULL,
[FK_TableC] int NULL,
[Value] single NULL
)
I ...