0% found this document useful (0 votes)
13 views

Course 1 Module 03 Lesson 2

This document discusses integrity rules for relational databases, including entity integrity enforced by primary keys and referential integrity enforced by foreign keys. It defines primary keys as unique column values that cannot be null and foreign keys as values that must match the primary key in another table to ensure valid references between tables. Examples show violations like orphaned foreign key values and missing foreign keys. Diagrams can visualize the one-to-many relationships and associated primary and foreign keys between tables.

Uploaded by

Rom
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Course 1 Module 03 Lesson 2

This document discusses integrity rules for relational databases, including entity integrity enforced by primary keys and referential integrity enforced by foreign keys. It defines primary keys as unique column values that cannot be null and foreign keys as values that must match the primary key in another table to ensure valid references between tables. Examples show violations like orphaned foreign key values and missing foreign keys. Diagrams can visualize the one-to-many relationships and associated primary and foreign keys between tables.

Uploaded by

Rom
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Information Systems Program

Module 3
Relational Data Model and
CREATE TABLE Statement

Lesson 2: Integrity Rules


Lesson Objectives
• Identify 1-M relationships and associated PKs
and FKs
• Find errors in rows with either orphan FKs or
missing FKs
• Identify situations for FK requirements
– FK is necessary
– FK can have the null value

Information Systems Program


Integrity Rules
• Entity integrity: primary keys
– Each table has column(s) with unique values
– No missing values for primary keys
– Ensures traceable entities
• Referential integrity: foreign keys
– Values of a column in one table match values from a
source table
– Ensures valid references among tables

Information Systems Program


Integrity Rule Violations

Student Offering
StdNo StdLastName OfferNo CourseNo
123-45-6789 WELLS 1234 IS320
124-56-7890 KENDALL 4321 IS320
234-56-7890 NORBERT
-- JONES

Enrollment
StdNo OfferNo
123-45-6789 1234

234-56-7890 1234

123-45-6789 4321

124-56-7890 4321

234-56-7890 6789

-- 4321

Information Systems Program


Oracle Relational Diagram

Information Systems Program


Summary
• Identify primary keys and foreign keys
• Visualize relationships
• Understanding existing databases is crucial to
query formulation

Information Systems Program

You might also like