SQL -Structured Query Language - Normalization - 1 NF Tutorial
- Each record must be unique.
- Each cell must contain a single value.
For example-
The 1st table is not 1 NF form because of multiple values in single-cell – contact_no.
But after splitting the row uniquely and single value in a single cell, the 2nd table becomes 1NF form.
Here the composite key is used to identify rows.
Now, what are the primary key and composite key?
Primary keys are unique, cannot be null, and auto-increment.
But this table doesn’t contain a primary key.
Hence we use here a composite key
A composite key is a combination of two or more column which is used to identify a record uniquely. It acts as a primary key.
For example-
Here user_id,first_name,last_name are common. Only difference is contact_no.
Hence we use user_id,contact_no or first_name,contact_no or last_name,contact_no to uniquely identify the records.