IFT - Assignment 7
IFT - Assignment 7
Define:
2NF - When all attributes of a table, other than the primary key, are fully dependent on
the primary key of the table. If there are more than one primary key, this rule still
applies.
3NF - If a table doesn’t violate the 2NF rule as well as, if no other attribute other than
BCNF - When all attributes of a table are only functionally dependent on the primary key
and when we have a functional dependency like X -> A, that makes X a superkey.
2. The main difference between 3NF and BCNF is the fact that BCNF is stricter than 3NF.
requirement in 3NF.
1NF - If an address table has an attribute of address and it holds a users original address
and the users new address, this would be a violation of the 1NF because of redundancy.
We could split this table up into two, one containing multiple rows with id and the
addresses, and the other containing the id and all of the other information in the original
table.
2NF - If there is a table called courses that has three primary keys of course_id,
semester_id, and instructor and another attribute of class_name. This violates 2NF
because in order to find out the class name we would only need the course_id and
which instructor is teaching said course. Fixing this violation would be to make this into
two tables with one with the unnecessary primary key from the original table and an id
3NF - A table called people holds a primary key called user_id, and attributes
user_name, user_state, user_country, and user_age. This would violate 3NF because it
user_state depends on user_id. In order to fix this violation we would split this table into
two, the second table including user_state and user_country, in order to get rid of