10. 3NF Examples
Reminder, 3NF means:
- It is already in 2NF
- There are no non-key attributes that depend on another non-key attribute
This is not in strict 3NF as the City could be obtained from the Post code attribute. If you created a table containing postcodes then city could be derived.
|12123||Saw IV||18||Eighteen and over|
The Description of what the certificate means could be obtained frome the certifcate attribute - it does not need to refer to the primary key VideoID. So split it out and use the primary key / secondary key approach.
|12123||LON23||1 Leicester Square. London|
|12443||COV2||34 Bramby St, Coventry|
|354||MAN4||56 Croydon Rd, Manchester|
|LON23||1 Leicester Square. London|
|COV2||34 Bramby St, Coventry|
|MAN4||56 Croydon Rd, Manchester|
In this case the database is almost in 3NF - for some reason the Cinema Address is being repeated in the Client table, even though it can be obtained from the Cinemas table. So simply remove the column from the client table
In this case the cost of any order can be obtained by multiplying quantity by price. This is a 'calculated field'. The database is larger than it needs to be as a query could work out the cost of any order. So to be in strict 3NF you would remove the Cost column.
Copyright © www.teach-ict.com