Professional Documents
Culture Documents
• Overview
• Information and Data Models
• The relational model
• Entity-Relationship diagrams
• Types of relationships
• Mapping entities to tables
• Relational model concepts
• Relational model constraints
• Normalization
• Videos
• db2university.com course AA001EN
• Lesson 1: Relational database concepts
• Overview
• Information and Data Models
• The relational model
• Entity-Relationship diagrams
• Types of relationships
• Mapping entities to tables
• Relational model concepts
• Relational model constraints
• Normalization
• Overview
• Information and Data Models
• The relational model
• Entity-Relationship diagrams
• Types of relationships
• Mapping entities to tables
• Relational model concepts
• Relational model constraints
• Normalization
• Network • Semantic
• Hierarchical • Object-oriented
• Relational • Object-relational
• Entity-Relationship • Semi-structured
• Extended relational
• Overview
• Information and Data Models
• The relational model
• Entity-Relationship diagrams
• Types of relationships
• Mapping entities to tables
• Relational model concepts
• Relational model constraints
• Normalization
• Building Blocks
• Entities Entity
• Attributes Attribute
Title
Description
Editon
Pages
ISBN Price
House Phone #
Height Order #
15 © 2011 IBM Corporation
Did you get them right?
House Phone #
Height Order #
16 © 2011 IBM Corporation
Agenda
• Overview
• Entity-relationship diagrams
• The relational model
• Entity-Relationship diagrams
• Types of relationships
• Mapping entities to tables
• Relational model concepts
• Relational model constraints
• Normalization
• Building Blocks
– Entity sets
– Relationship sets
Title
Description
Editon
Pages
ISBN Price
Author_Id Lastname
City Email
One-to-one Relationship
One-to-many Relationships
Many-to-many Relationships
• Overview
• Entity-relationship diagrams
• The relational model
• Entity-Relationship diagrams
• Types of relationships
• Mapping entities to tables
• Relational model concepts
• Relational model constraints
• Normalization
Title
Description
Editon
Pages
ISBN Price
Title
Description
Entity Editon
Pages
ISBN Price
Table
Columns
28 © 2011 IBM Corporation
Mapping entity to a table (Continued)
Table: Book
Title Edition Year Price ISBN Pages Aisle Description
• Overview
• Entity-relationship diagrams
• The relational model
• Entity-Relationship diagrams
• Types of relationships
• Mapping entities to tables
• Relational model concepts
• Relational model constraints
• Normalization
• Building Blocks
• Relation
• Sets
• Relational Database
• Relation
• Relation Schema
• Relation Instance
• Overview
• Entity-relationship diagrams
• The relational model
• Entity-Relationship diagrams
• Types of relationships
• Mapping entities to tables
• Relational model concepts
• Relational model constraints
• Normalization
Business Rules
Referencing
Data Integrity
Parent Table
Dependant Table Foreign Key
AUTHOR
Author_ID Lastname Firstname Email City Country
[PK]
AUTHOR
Author_ID Lastname Firstname Email City Country
[PK]
AUTHOR
Author_ID Lastname Firstname Email City Country
[PK]
A1
NULL Chong Raul rfc@ibm.com Toronto CA
AUTHOR
Author_ID Lastname Firstname Email City Country
[PK]
A1
NULL Chong Raul rfc@ibm.com Toronto CA
A4
NULL Sharma Neeraj ns@ibm.com Chennai IN
Referencing
AUTHOR
Author_ID Lastname Firstname Email City Country
[PK]
AUTHOR
Author_ID Lastname Firstname Email City Country
[PK]
AUTHOR
Author_ID Lastname Firstname Email City Country
AUTHOR
Author_ID Lastname Firstname Email City Country
AUTHOR
Author_ID Lastname Firstname Email City Country
AUTHOR
Author_ID Lastname Firstname Email City Country
A1 Chong Raul
NULL rfc@ibm.com Toronto CA
A3 Hakes
NULL Ian ih@ibm.com Toronto CA
BOOK
Title Edition Year Price ISBN Pages Aisle Description
BOOK
Title Edition Year Price ISBN Pages Aisle Description
• Overview
• Entity-relationship diagrams
• The relational model
• Entity-Relationship diagrams
• Types of relationships
• Mapping entities to tables
• Relational model concepts
• Relational model constraints
• Normalization
Problem:
If John moves to a new city, all entries related to John must be updated
53 © 2011 IBM Corporation
Normalization (continued)
No redundancy, no anomalies, no loss of information