ID | Name | Number | Quantity | Measurement |
---|---|---|---|---|
101 | A | 2541 | 5 | cm |
102 | A | 2341 | 5 | cm |
103 | B | 4561 | 15 | cm |
104 | B | 1896 | 15 | cm |
105 | C | 1546 | 30 | mt |
106 | C | 2531 | 30 | mt |
107 | C | 7852 | 30 | mt |
I have the above table and now, I want to convert it into BCNF, 4th & 5th Normal Form. I've tried and read online and also have gone through youtube videos but not able to do it for this table.
Any help is appreciable. Thanks in advance.
Edit: This is my thought for
- 1NF: For any table to be in first normal form-
- All non-key columns of a table should depend on the primary key.
- There should be unique entries in the table.
Hence, on having a closer look at the table, we notice that the table is already in the first normal form since it satisfies the above properties. Here we have considered ‘ID’ to be our primary key. The table structure is similar to the one already given but for our convenience we will reorder it. We will consider the table to be like – [ID, Name, Number, Quantity, Measurement].
- 2NF: For a table to be in second normal form-
- A table should be in 1NF.
- All non-key columns depend on the whole primary key.
- A table with a simple primary key is automatically in second normal form.
Since, all the above properties are satisfied by the current table structure it is in 2NF too. Hence, the table structure is- [ID, Name, Number, Quantity, Measurement].
- 3NF (Not so sure): It occurs in 2NF when a non-key column depends on another non-key column. A similar thing happens in the table we are given here. The Number and Measurement depend on the Name which is causing redundancy. Moreover, for the table to be in 3NF-
- The table should be in 2NF.
- All non-key columns depend on the key, the whole key, and nothing but the key. Thus, we need to normalize our table. For this we decompose the table as below- ✓ Table 1: ID (PK), Number, Name ✓ Table 2: Name (PK), Number ✓ Table 3: Name (PK), Measurement