I am trying to understand what BCNF is and I have a relation like this:
Student(id, ssn, email, name, surname)
where
Are there anything that violates BCNF and if so, how can I overcome this situation with a better design?
EDIT
I am trying to write my functional dependencies but please correct me if I'm wrong.
There are three attributes which determine the others, so it's confusing that ssn and email both exist at left hand side and right hand side of the equations. It seems that this relation is not in bcnf but there must be something wrong :)
id -> (ssn, email, name, surname)
ssn -> (id, email, name, surname)
email -> (id, ssn, name, surname)
Candidate Keys and BCNFEach table can contain multiple candidate keys, any one of which can qualify as the primary key. A table contains only one primary key. Candidate keys must be unique.
Surrogate keys are unique. Because surrogate keys are system-generated, it is impossible for the system to create and store a duplicate value.
In a temporal database, it is necessary to distinguish between the surrogate key and the business key. Every row would have both a business key and a surrogate key. The surrogate key identifies one unique row in the database, the business key identifies one unique entity of the modeled world.
A surrogate key is a unique identifier used in databases for a modeled entity or an object. It is a unique key whose only significance is to act as the primary identifier of an object or entity and is not derived from any other data in the database and may or may not be used as the primary key.
Yes, your table is in BCNF. This is because you don't have any overlapping candidate keys - i.e. there's no attributes which appear in two different keys.
If you had some other attribute, X, which formed part of the keys - e.g. (SSN, X) and (email, X) - then your table would fail BCNF because X should be the same for a given SSN and email pair. These key definitions would allow different values of X for given SSN and emails.
For a good explanation of BCNF, read this answer.
The way to answer your question properly is to identify what functional dependencies are supposed to apply. Write down what you think the dependencies are. If the left-hand side of every non-trivial dependency is a superkey then the relation satisfies BCNF.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With