Reputation
2,060
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
8 15
Newest
 Caucus
Impact
~90k people reached

Jun
28
comment SQL Server vs Oracle
This might help.
Jun
10
comment Is it acceptable to have circular foreign key references\How to avoid them?
@Pieter, 1-1 isn't the only example of a join dependency, and it's not even a particularly special case. There are cases where join dependency constraints make perfect sense.
Jun
10
comment Is it acceptable to have circular foreign key references\How to avoid them?
@Pieter, Enforcing join dependencies is not something you would ever recommend? Why? What do you have against data integrity constraints?
Jun
3
comment Is it acceptable to have circular foreign key references\How to avoid them?
Leaving aside the specifics of any one example, in general terms there is nothing necessarily wrong or "flawed" about having reciprocal (i.e. "circular") referential integrity constraints. This is in effect just an example of a Join Dependency. Join dependencies are a good thing in principle if your DBMS allows you to implement them. It's just that in SQL DBMSs it isn't very easy to implement complex dependencies between tables.
Jun
2
comment Three questions about Database design
Why would you want to allow duplicate user names? I think that most social networking sites don't allow that.
Apr
30
comment Normalization of library book table with multiple authors
I agree but I didn't quite understand your concern about nulls so I wanted to emphasize the point that no nulls are needed.
Apr
24
comment How to get a surrogate key value in order to put a foreign key in and create relationship?
You need to fix your database design. You can't expect to get useful results if you only have surrogate keys and no alternate real world keys to identify information with. It's like putting your coat into a coat check without getting a ticket for it!
Apr
16
comment Is the table in 3NF?
@Emilie, According to your sample data ISBN does NOT determine SKU. There are 3 different SKUs for a single ISBN. If ISBN->SKU and SKU is a key then ISBN must be a key as well. In that case there would be no violation of 3NF.
Apr
5
comment What normal form does a surrogate key violate?
Your interpretation of 3NF is not correct. 3NF is violated where there is a dependency on a non-prime attribute (i.e. a "transitive" dependency). Non-prime means an attribute that is not part of any candidate key. Dependence on several alternative keys therefore is not a violation of 3NF and such dependencies are implicit and required whenever a table has more than one key. By definition every attribute of a relation is functionally determined by every candidate key of that relation.
Mar
29
comment Why aren't primary key / foreign key matches used for joins?
SQL did not come first! The relational model (which included the concept of foreign keys of course) was first outlined by E.F.Codd in 1969. SEQUEL, as it was then, didn't see the light of day until around 1974. Its inventors made it clear from the outset that SEQUEL/SQL was intended to be based on the pre-existing relational model - although SQL did fall short of being a truly relational language.
Mar
5
comment How to sort rows to appear alternating (e.g. A B A B … )?
Does your table have a key? It would be useful to know. Your column X contains duplicates and there appears to be nothing else to define the ordering of the table with.
Mar
2
comment Question about choosing primary key
Yes. Therefore the table does satisfy 3NF.
Mar
2
comment Question about choosing primary key
Thomas, My point (and ypercube's) is that PersonID --> EmployeeID --> {Employee Attributes} is NOT a transitive dependency if EmployeeID is a key as well as PersonID. 3NF requires no distinction between primary and "non-primary" candidate keys. All candidate keys are equally important in 3NF as the Wikipedia link you posted makes very clear (I'm not advocating Wikipedia as a generally reliable source of information but in this instance it happens to be more accurate than the other links you referred to).
Mar
2
comment Question about choosing primary key
PersonID and EmployeeID are both keys in Employee. On that basis there is no violation of 3NF.
Feb
3
comment If A and B are candidate keys, then AB is candidate key or not ?
ab doesn't mean the intersection of the domains a and b, it means the superkey {a,b}. That might have been clearer if the OP had put parentheses around it but the question is clearly about keys and superkeys.
Jan
5
comment Why should I create an ID column when I can use others as key fields?
If criminals are known to clone some identifier then surely that might be a very good reason to enforce the business rule that the attribute must be unique - i.e. not to "trip up" the system but to prevent the said duplicate values from entering the database and thereby red-flag any such attempts as potential fraud or errors requiring further investigation.
Nov
7
comment Uniqueidentifier vs. IDENTITY vs. Material Code --which is the best choice for primary key?
There is nothing purely "philosophical" about the need to identify real things accurately and to guarantee the uniqueness of meaningful data through key constraints. Natural keys are a very practical necessity.
Mar
21
comment Confusion with Foreign Keys
There's no reason in principle why primary key attributes shouldn't be foreign keys.
Mar
5
comment Column suitable for natural key?
@mircale, my point was that the reason for key constraints is to guarantee that infomration is not duplicated. If you don't enforce a natural key on some attribute then the values of that attribute may be duplicated on multiple tuples with different surrogate key values. That is apparently not what is wanted here.
Jan
4
comment Primary Key Question
"if I have a key of FirstName, LastName, Email on my Student table, and then have to repeat that information in my Classes table then I'm duplicating data in that table and breaking one of the normal forms. Is that not correct?" That is not correct. In any case it's a poor example because it seems highly unlikely that firstname and lastname would be part of a key for students in any real or practical sense.