0% found this document useful (0 votes)
6 views12 pages

Database

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views12 pages

Database

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

🔑

Database Keys
A unique identifier for
each record in a table,
used to enforce entity
integrity.
Primary Key…
Foreign Key…
Establishes a relationship
between tables, refers to a
primary key in another
table.
Made up of multiple
columns, used when a
single column can't
uniquely identify a record.
Composite Key
EXAMPLE:
• The "Students" table has several columns:
Student ID
First Name
Last Name
Email Address
Phone Number
WHY DO WE
NEED KEYS IN A
DATABASE?
UNIQUE
IDENTIFICATION
Keys provide a unique identifier for each record
in a table. This allows the database to distinguish
between records and ensures that each record is
referenced accurately.
DATA SECURITY
& INTEGRITY
Keys help to maintain the integrity of the data by enforcing
relationships between tables and preventing duplicate data. Keys are
used to control access to data by granting or denying access
to specific records or tables.
Referential Integrity:
Keys provide a unique identifier for each
record in a table. This allows the database to
distinguish between records and ensures
that each record is referenced accurately.
Task:
- Identify the primary key for
each table.

- Identify the foreign key in the


Orders table and explain how it
relates to the Customers table.
ACTIVITY
Identify the following from each table in DVD rental database :
- primary key
- Foreign key
- Candidate Key
- Composite Key
- Alternate Key

You might also like