SQL Constraints Unit III (1)
SQL Constraints Unit III (1)
KSN PRASAD
Lecturer in Computer Science
Govt. Degree College
Ravulapalem
SQL Constraints
Example
>ALTER TABLE Persons ADD PRIMARY KEY (ID);
4.SQL FOREIGN KEY Constraint
• A FOREIGN KEY is a key used to link two tables together.
• A FOREIGN KEY is a field in one table(Child table) that
refers to the PRIMARY KEY in another table(Parent table).