This questions is obviously a homework question. I can't understand my professor and have no idea what he said during the election. I need to make step by step instructions to normalize the following table first into 1NF, then 2NF, then 3NF.
I appreciate any help and instruction.
Normalize Your Database to 3NF As mentioned, you should build upon the previous normal form as you normalize your data. The third normal form (3NF) must meet the 2NF requirements. In addition, you must remove any transitive dependencies.
The third normal form (3NF) must meet the 2NF requirements. In addition, you must remove any transitive dependencies. The relation is in 2NF. Transitive dependencies are removed. What is a transitive dependency?
11.1 The second normal form of the normalization has two properties. 12.1 The third normal form of the normalization has two properties. What is Normalization? Standardization is a database arrangement procedure that lessens data redundancy and gets rid of unpleasant attributes like Insertion, Update and Deletion Anomalies.
Normalize Your Database to 1NF First normal form eliminates repeating groups. This means that multi-valued attributes have been removed, and there is only a single value at the crossroads where the table record and column come together. Primary keys are also established with the first normal form; uniquely identifying records in a table.
Okay, I hope I remember all of them correctly, let's start...
To make them very short (and not very precise, just to give you a first idea of what it's all about):
a column "state
" has values like "WA, Washington". NF1 is violated, because that's two values, abbreviation and name.
Solution: To fulfill NF1, create two columns, STATE_ABBREVIATION
and STATE_NAME
.
Imagine you've got a table with these 4 columns, expressing international names of car models:
COUNTRY_ID
(numeric, primary key)CAR_MODEL_ID
(numeric, primary key)COUNTRY_NAME
(varchar)CAR_MODEL_NAME
(varchar)The table may have these two data rows:
That says, model "Fox" is called "Fox" in USA, but the same car model is called "Polo" in Germany (don't remember if that's actually true).
NF2 is violated, because the country name does not depend on both car model ID and country ID, but only on the country ID.
Solution: To fulfill NF2, move COUNTRY_NAME
into a separate table "COUNTRY" with columns COUNTRY_ID
(primary key) and COUNTRY_NAME
. To get a result set including the country name, you'll need to connect the two tables using a JOIN.
Say you've got a table with these columns, expressing climatic conditions of states:
STATE_ID
(varchar, primary key)CLIME_ID
(foreign key, ID of a climate zone like "desert", "rainforest", etc.)IS_MOSTLY_DRY
(bool)NF3 is violated, because IS_MOSTLY_DRY only depends on the CLIME_ID (let's at least assume that), but not on the STATE_ID (primary key).
Solution: to fulfill NF3, put the column MOSTLY_DRY
into the climate zone table.
Here are some thoughts regarding the actual table given in the exercise:
I apply the above mentioned NF rules without to challenge the primary key columns. But they actually don't make sense, as we will see later.
So if you remove all columns which violate NF2 or NF3, only the primary key remains (EMP_ID and DEPT_CD). That remaining part violates the given business rules: this structure would allow an employee to work in multiple departments at the same time.
Let's review it from a distance. Your data model is about employees, departments, skills and the relationships between these entities. If you normalize that, you'll end up with one table for the employees (containing DEPT_CD as a foreign key), one for the departments, one for the skills, and another one for the relationship between employees and skills, holding the "skill years" for each tuple of EMP_ID and SKILL_CD (my teacher would have called the latter an "associative entity").
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