Linked Questions

1
vote
1answer
93 views

How to properly implement relationship between a user and multiple other users [duplicate]

I have a table with the following structure: Table_1 --- UserId (int) --- UserName (varchar) A user can have a relation with other users. Meaning, a UserId from Table_1 can have a relation with ...
34
votes
5answers
38k views

How should I design a relationship table for friendship?

If A is a friend of B, then should I store both values AB and BA, or one is enough? What are the advantages and disadvantages of both methods. Here is my observation: If I keep both then I have to ...
16
votes
1answer
4k views

Designing a database for a video game business domain with multiple many-to-many relationships

I am relatively new to database design, and I decided to make my own hypothetical database for practice. However, I am having trouble modeling and normalizing it, as I esteem that there are numerous ...
8
votes
2answers
2k views

Advice on a basic design, first time database design

I am taking a course to become a Java developer. The course involves using databases but we never really design any, unfortunately. Most of the time we get pre-made databases and we have to ...
2
votes
1answer
2k views

How to remove data redundancy in product table if multiple suppliers are there for same product

I am designing a database where I have different products and suppliers. For example, I have a product, "mobile phone", say an Apple 5S. This will be sold through my website from different ...
3
votes
2answers
581 views

Should I create multiple tables for different task states?

I have a tasks table in my database and, in the business domain of interest, tasks can have multiple states: open, begun, in review, completed. Despite having open and begun in the same table, ...
2
votes
1answer
748 views

Creating a Friendships database that includes a Block Friend option

My database teacher asked us to program a clone of Facebook using MySQL as the database management system, so I'm trying to represent a friends relationship in the corresponding database. So far I ...
1
vote
1answer
211 views

What to name a field that includes Store and Version ID

I am building a database that manages the definitions for a POS system (menu items, cashiers etc). It will include many stores and many versions. So, typical table will look like this (MenuItems ...
2
votes
1answer
63 views

Assessing the normal form for a relation with a multi-valued attribute

Assume that you have designed the following schema of relations: COURSES (CID, CNAME) STUDENTS(SID, SNAME, FAV_CIDS) However, you can not have a relation with set valued attributes (Did not really ...
0
votes
1answer
35 views

One column link to others

I always search my problem with different search terms but the problem I am facing now I can't express this in search keyword. So instead I came here to ask directly from humans as machines were ...