I'm wondering whether a attribute can have multiple NULL values and still be a candidate key. Let's say we have a table with 3 columns, airport_id, airport_name, IATA_code. Primary_key is a airport_id. IATA_code is not always provided for an airport but when it is, it uniquely identifies an airport. Can I therefore say that IATA_code is a candidate key (but can not be a primary key) and therefore there exist functional dependency between IATA_code --> airport_id ?
Asked
Active
Viewed 595 times
-1
-
Does this answer your question? [Does an empty SQL table have a superkey? Does every SQL table have one?](https://stackoverflow.com/questions/46024902/does-an-empty-sql-table-have-a-superkey-does-every-sql-table-have-one) – philipxy Nov 21 '21 at 13:25
-
Is this about the relational model or SQL? The definitions of superkey & CK don't care what the values are. Just apply them. How are you stopped quoting them & applying them? What has your research shown? [ask] [Help] "Identifies", whatever it means, isn't part of those definitions. If you have "tables" that allow 2 copies of the same row because they have a null, that isn't a relation & the terms don't apply to that thing. On the other hand if you are using different definitions for the same terms in some other context, what is the context & the definitions? – philipxy Nov 21 '21 at 13:29
1 Answers
0
According to the definition of candidate key in relational database, you cannot say IATA_code is one of candidate keys.
Candidate key is the set of attributes by which it is possible to identify each row of the table. Therefore, if some attribute is nullable, it cannot be one of candidate keys.

Broccoli_Salad
- 120
- 7