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

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.
Nov
30
revised How to find functional dependancies from a relational schema?
grammar and spelling.
Nov
30
answered How to find functional dependancies from a relational schema?
Nov
20
comment Database design: Two 1 to many relationships to the same table
@AmadeoGallardo The answer is "it depends". Querying against a key is always pretty efficient, since you can generally count on an index scan at least, if not a seek, and these are quick operations. The issue becomes when you query across both keys in the two foreign keys solution. Here you're asking the query optimizer to do an either/or operation. At best this will double the cost of the query, usually a little worse, since you have to query against one key, then the other, then merge the results.
Nov
17
comment Should I create a child table without primary key?
It's hard to understand why you don't think you need a unique key. Please explain why your primary key isn't just the combination of receipt_id, prod_id and coupon_id. It looks like what you're getting at is this being a compound primary key. Are you asking whether you need to add a surrogate key?
Oct
27
answered Database modelling : Creating a model for restaurant application which gives statistics