Reputation
7,980
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
1 13 27
Newest
 Good Answer
Impact
~232k people reached

Feb
3
answered Is it possible to display this restriction in an ER diagram?
Jan
26
awarded  Good Answer
Jan
17
comment Animals hierarchy use-case: multiple farms, multiple species
@Meglio - Changing primary keys is a sure way to find yourself with orphaned child records. Since in the real world, it's possible that unique identifiers can change, many people like to create surrogate keys which never change. You can guarantee this because you control the surrogate key. The idea is that each new animal gets your private unique ID number (or GUID, whatever), which never changes. If the external IDs change that's OK, update that record. Build your parent/child relationships with the private keys that you control. Your users don't even have to see the private keys at all.
Jan
17
answered Animals hierarchy use-case: multiple farms, multiple species
Jan
17
answered should I denormalize for user profiles?
Jan
13
answered Can different tables have columns with the same name if those columns are not primary keys?
Jan
10
comment What is the db-structure behind sites with multiple similar subdomains, like Stack exchange?
Yes, that is the search term you should use.
Jan
10
comment What is the db-structure behind sites with multiple similar subdomains, like Stack exchange?
Welcome to DBA Stack Exchange. You should look around here and in StackOverflow. This question is already discussed in a few places. Here is a "classic" article on the subject: msdn.microsoft.com/en-us/library/aa479086.aspx
Jan
1
awarded  mysql
Dec
31
revised What's the best way to diagram this “relation” looking for performance and|or disk space savings
Added a clarification
Dec
31
answered What's the best way to diagram this “relation” looking for performance and|or disk space savings
Dec
28
answered Database normalization: Which is the best fit?
Dec
28
revised Database normalization: Which is the best fit?
Corrected grammar and spelling and clarified language and formatting
Dec
24
comment What is a basic model for making a database with users and groups?
@levi - Another possibility is that you really need to have a mixture of individual and role rights. In that case, your ROLE table can be subtyped into Individual and Group types, where the group type has zero to many members and the individual type has exactly one member. How you enforce these cardinality rules is up to you. It could be done declaratively in your database schema, in which case you need to change the pictured schema slightly. Or you might use application logic, in which case your schema still looks like what I've pictured above.
Dec
24
comment What is a basic model for making a database with users and groups?
@levi - If that happens then one way to handle it is to make a special role like "Bob's Special Permissions", which is a bit of a kludge, but it solves the problem as long as you don't have too many exceptions like this. It is possible that what you think is an individual exception may actually be a subtle new role that you haven't considered. What happens when Bob quits? Does Bob's replacement also need that exceptional permission? If so then you actually have a role with one member, not an exception.
Dec
24
awarded  Enlightened
Dec
24
awarded  Nice Answer
Dec
20
comment library data modeling
@HyunSULee - You're welcome. Feel free to click the check mark to indicate that you accept my answer.
Dec
19
answered library data modeling
Dec
14
comment Relation between first name and last name
See my answer to this similar question: dba.stackexchange.com/questions/65808/…. There is a difference between coincidental occurrence and relationships.