- serve to uniquely identify a row in the table
- build an index on Primary key to facilitate fast search and retreival
- a key that is used to link 2 tables together
- table containing foreign key -> child table
- table containing primary key -> referenced or parent table
- prevents invalid data from being inserted
- row in the parent table cannot be deleted if referenced
- primary key of a row in the parent table cannot be updated
- Each column can only have atomic (a single) value
- Unique column name
non-key field must provide a fact about the key and only the key
- No partial dependency
- satisfies 1NF, 2NF
- Not partial means full
- Hence, Full functional dependency
- No transistive dependency
- satisfies 1NF, 2NF, 3NF
- AKA 3.5NF
- satisfies {1..3}NF, 3.5NF
- Primary key for every functional dependency
X->Y
,X
should be primary key
x -> y
(determinant) (dependent)
- x is a key field
- y is a non-key field
- Can read the values of
y
by using the value ofx
from a table
- non-key field is not fully dependent on primary key
- Primary keys:
student_id
,subject_id
subject_id -> teacher
teacher
column only dependes onsubject
and NOT onstudent
- non-key field depends on another non-key filed
- which doesn't depend on primary key
- Primary keys:
student_id
,subject_id
exam_name -> total_marks
total_marks
depends onexam_name
which is NOT a primary key