Linked Questions

1 vote
1 answer

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 ...
Aousaf Rashid's user avatar
36 votes
5 answers

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 ...
roxrook's user avatar
  • 485
16 votes
1 answer

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 ...
dpolaristar's user avatar
9 votes
2 answers

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 ...
Vahx's user avatar
  • 225
5 votes
2 answers

Should I create multiple tables for different entity states, statuses or stages?

I have a tasks table in my database and, in the business domain of interest, tasks can have multiple states: “open”, “begun”, “in review” and “completed”. Despite having “open” and “begun” in the same ...
Mackey18's user avatar
  • 153
2 votes
1 answer

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 ...
Vijay Damale's user avatar
3 votes
1 answer

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 ...
Ivan Trigueiro's user avatar
1 vote
1 answer

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 ...
Craig's user avatar
  • 503
0 votes
1 answer

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 ...
fwd82's user avatar
  • 101
2 votes
1 answer

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 ...
conthoughisck8er's user avatar