An Example: Video Rental System - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

An Example: Video Rental System

Description:

BirthDate. CompanyID. E-R Analysis ... Similar objects are ... PhoneNumber Character 10 Telephone. BirthDate Date DD-MM-YY. CustomerID Character 8 Unique ID ... – PowerPoint PPT presentation

Number of Views:625
Avg rating:3.0/5.0
Slides: 22
Provided by: simon147
Category:

less

Transcript and Presenter's Notes

Title: An Example: Video Rental System


1
An Example Video Rental System
2
E-R Analysis
  • Similar objects are grouped into entity sets
  • Determine the attributes (or properties) of
    objects in the sets. Usually choose one of the
    attributes of an entity or relationship set to be
    the identifier
  • Model all interactions between the objects in the
    entity sets by relationship and relationship sets
  • Model relationship cardinality
  • Model relationship participation

3
ERD Example
MOVIE
CUSTOMER
PRODUCER
4
E-R Analysis
  • Similar objects are grouped into entity sets
  • Determine the attributes (or properties) of
    objects in the sets. Usually choose one of the
    attributes of an entity or relationship set to be
    the identifier
  • Model all interactions between the objects in the
    entity sets by relationship and relationship sets
  • Model relationship cardinality
  • Model relationship participation

5
Attributes
  • Attribute - property or characteristic of an
    entity type
  • Classifications of attributes
  • Required versus Optional Attributes
  • Simple versus Composite Attribute (e.g. name)
  • Single-Valued versus Multi-valued Attribute (e.g
    Qualifications)
  • Stored versus Derived Attributes (e.g Age DoB)
  • Identifier Attributes
  • Identifier - An attribute (or combination of
    attributes) that uniquely identifies individual
    instances of an entity type
  • Simple Key versus Composite Key

6
ERD Example
Title
FIrstName
LastName
MovieID
Duration
CustomerID
Address
Rating
MOVIE
CUSTOMER
PhoneNumber
BirthDate
CompanyID
PRODUCER
CompanyName
Country
7
E-R Analysis
  • Similar objects are grouped into entity sets
  • Determine the attributes (or properties) of
    objects in the sets. Usually choose one of the
    attributes of an entity or relationship set to be
    the identifier
  • Model all interactions between the objects in the
    entity sets by relationship and relationship sets
  • Model relationship cardinality
  • Model relationship participation

8
Relationships
  • Relationship Types vs. Relationship Instances
  • The relationship type is modelled as the diamond
    and lines between entity typesthe instance is
    between specific entity instances
  • Relationships can have attributes
  • These describe features pertaining to the
    association between the entities in the
    relationship
  • Two entities can have more than one type of
    relationship between them (multiple
    relationships)
  • Associative Entity combination of relationship
    and entity

9
ERD Example
Title
FIrstName
LastName
MovieID
Duration
CustomerID
Address
Rating
rent
MOVIE
CUSTOMER
PhoneNumber
directed
BirthDate
Date_Rented
Due_Date
companyID
PRODUCER
CompanyName
Country
10
E-R Analysis
  • Similar objects are grouped into entity sets
  • Determine the attributes (or properties) of
    objects in the sets. Usually choose one of the
    attributes of an entity or relationship set to be
    the identifier
  • Model all interactions between the objects in the
    entity sets by relationship and relationship sets
  • Model relationship cardinality
  • Model relationship participation

11
Cardinality of Relationships
  • One-to-One
  • Each entity in the relationship will have exactly
    one related entity
  • One-to-Many
  • An entity on one side of the relationship can
    have many related entities, but an entity on the
    other side will have a maximum of one related
    entity
  • Many-to-Many
  • Entities on both sides of the relationship can
    have many related entities on the other side

12
ERD Example
Title
FIrstName
LastName
MovieID
Duration
CustomerID
Address
Rating
rent
MOVIE
CUSTOMER
PhoneNumber
directed
BirthDate
Date_Rented
Due_Date
CompanyID
PRODUCER
CompanyName
Country
13
E-R Analysis
  • Similar objects are grouped into entity sets
  • Determine the attributes (or properties) of
    objects in the sets. Usually choose one of the
    attributes of an entity or relationship set to be
    the identifier
  • Model all interactions between the objects in the
    entity sets by relationship and relationship sets
  • Model relationship cardinality
  • Model relationship participation

14
ERD Example
Title
FIrstName
LastName
MovieID
Duration
CustomerID
Address
Rating
rent
MOVIE
CUSTOMER
PhoneNumber
directed
BirthDate
Date_Rented
Due_Date
CompanyID
PRODUCER
CompanyName
Country
15
Mapping Rules (Simplified)
  • Map Regular Entities
  • Map Binary Relationships
  • One-to-many Relationships
  • Many-to-many relationships

16
Mapping Regular Entities
MOVIE
MovieID
Title
Duration
Rating
17
Mapping One-to-many relationships
Title
MovieID
Duration
Rating
MOVIE
MOVIE
MovieID
Title
Rating
Rating
DirectorID
directed
PRODUCERR
CompanyName
CompanyID
Country
CompanyID
PRODUCER
CompanyName
Country
18
Mapping Many-to-many relationships
Title
FIrstName
LastName
MovieID
Duration
CustomerID
Address
Rating
rent
MOVIE
CUSTOMER
PhoneNumber
BirthDate
Date_Rented
Due_Date
MOVIE
MovieID
Title
Rating
Duration
RENTAL
Due_Rented
MovieID
CustomerID
Due_Date
CUSTOMER
CustomerID
FName
Address
DoB
Phone
LName
19
Final Map
MOVIE
MovieID
Title
Rating
Audience
CompanyID
RENTAL
Due_Rented
MovieID
CustomerID
Due_Date
CUSTOMER
CustomerID
FName
Address
DoB
Phone
LName
20
Resulting 4 Tables
Any problems with Rental Table ?
21
Metadata for Customer
  • Customer
  • FirstName Character 30 First name
  • LastName Character 30 Last name
  • Address Character 60 Location
  • PhoneNumber Character 10 Telephone
  • BirthDate Date DD-MM-YY
  • CustomerID Character 8 Unique ID
Write a Comment
User Comments (0)
About PowerShow.com