Professional Documents
Culture Documents
PRESENTATION Dbms 1 Completed
PRESENTATION Dbms 1 Completed
2 Mary 19 B
3 Alex 20 A
Unique Constraint
Unique Constraint: Ensures values in a column are
unique (no duplicates)
Multiple columns can be part of a unique constraint
1 john@example.com John HR
3 alex@example.com Alex IT
Foreign Key Constraint
Foreign Key Constraint: Establishes relationships
between tables
References a primary key in another table
Ensures referential integrity
Example Tables: "Orders" and "Customers"
"Orders" table has a foreign key "CustomerID"
referencing "Customers" table
Example Tables: "Orders" and "Customers"
Orders Table:
Customers Table:
1 Laptop 10
2 Smartphone 5
3 Tablet 0
Not Null Constraint
Not Null Constraint: Ensures a column cannot contain
null values
Requires every row to have a value in the specified
column
Example Table: "Books"
Columns: "BookID" (Primary Key), "Title", "Author",
"PublicationYear" (Not Null)
Example Table: "Books"