From E/R Diagrams to Relational Schema - PowerPoint PPT Presentation

About This Presentation
Title:

From E/R Diagrams to Relational Schema

Description:

From E/R Diagrams to Relational Schema Easier than ODL (using a liberal interpretation of the word easy ) - relationships are already independent entities – PowerPoint PPT presentation

Number of Views:57
Avg rating:3.0/5.0
Slides: 10
Provided by: Alon75
Category:

less

Transcript and Presenter's Notes

Title: From E/R Diagrams to Relational Schema


1
From E/R Diagrams to Relational Schema
Easier than ODL (using a liberal interpretation
of the word easy) - relationships are
already independent entities - only atomic
types exist in the E/R model. Entity sets
relations Relationships
relations Special care for
weak entity sets.
2

name
category
name
price
makes
Company
Product
Stock price
buys
employs
Person
name
ssn
address
3
Entity Sets to Relations
name
category
price
Product
Product Name
Category Price
gizmo gadgets
19.99
4
Relationships to Relations

Start Year
name
category
name
makes
Company
Product
Stock price
Relation MAKES (watch out for attribute name
conflicts) Product-name
Product-Category Company-name Starting-year
gizmo gadgets
gizmoWorks 1963
5
Handling Weak Entity Sets
affiliation
University
Team
number
sport
name
Relation TEAM Sport
Number University-name
mud wrestling 15
Montezuma State U.
- need all the attributes that contribute to
the key of Team - dont need a separate
relation for Affiliation.
6
Modeling Subclass Structure
Product
Platforms required memory
ageGroup topic
Educational Product
Software Product
Educational-method
Educ-software Product
7
Option 1 the ODL Approach
4 tables each object can only belong to a single
class Product(name, price, category,
manufacturer) EducationalProduct( name, price,
category, manufacturer, ageGroup,
topic) SoftwareProduct(
name, price, category, manufacturer, platforms,
requiredMemory)
EducationalSoftwareProduct( name, price,
category, manufacturer,
ageGroup, topic,
platforms,
requiredMemory)
8
Option 2 the E/R Approach
Product(name, price, category, manufacturer)
EducationalProduct( name, ageGroup, topic)
SoftwareProduct( name, platforms,
requiredMemory) No need for a relation
EducationalSoftwareProduct Unless, it has a
specialized attribute EducationalSoftwareProduc
t(name, educational-method)
9
Option 3 The Null Value Approach
Have one table Product ( name, price,
manufacturer, age-group, topic, platforms,
required-memory, educational-method)
Some values in the table will be NULL, meaning
that the attribute not make sense for the
specific product. How many more meanings will
NULL have??
Write a Comment
User Comments (0)
About PowerShow.com