SlideShare a Scribd company logo
2
Most read
3
Most read
12
Most read
ERD
Practice
Exercises
Database Design
Exercise 1
Problem
• A company database needs to store information
about employees (identified by ssn, with salary and
phone as attributes), departments (identified by
dno, with dname and budget as attributes), and
children of employees (with name and age as
attributes).
Exercise 1
Problem
• Employees work in departments; each department
is managed by an employee; a child must be
identified uniquely by name when the parent (who
is an employee; assume that only one parent works
for the company) is known. We are not interested in
information about a child once the parent leaves
the company.
• Draw an ER diagram that captures this information.
Exercise 1
Solution
• First, we shall design the entities and relationships.
o “Employees work in departments…”
o “…each department is managed by an employee…”
o “…a child must be identified uniquely by name when the parent (who is
an employee; assume that only one parent works for the company) is
known.”
Exercise 1
Solution
Exercise 1
Solution
o “…each department is managed by an employee…”
o “…a child must be identified uniquely by name when the parent (who is
an employee; assume that only one parent works for the company) is
known. “
o “We are not interested in information about a child once the parent
leaves the company.”
Exercise 2
Problem
• Although you always wanted to be an artist, you
ended up being an expert on databases because
you love to cook data and you somehow confused
database with data baste. Your old love is still there,
however, so you set up a database company,
ArtBase, that builds a product for art galleries. The
core of this product is a database with a schema
that captures all the information that galleries need
to maintain.
Exercise 2
Problem
• Galleries keep information about artists, their names
(which are unique), birthplaces, age,and style of
art. For each piece of artwork, the artist, the year it
was made, its unique title, its type of art (e.g.,
painting, lithograph, sculpture, photograph), and its
price must be stored. Pieces of artwork are also
classified into groups of various kinds, for example,
portraits, still lifes, works by Picasso, or works of the
19th century; a given piece may belong to more
than one group.
Exercise 2
Problem
• Each group is identified by a name (like those just
given) that describes the group. Finally, galleries
keep information about customers. For each
customer, galleries keep that person’s unique
name, address, total amount of dollars spent in the
gallery (very important!), and the artists and groups
of art that the customer tends to like.
• Draw the ER diagram for the database.
Exercise 2
Solution
• Like before, we begin with the entities and
relationships.
• “…artists, their names (which are unique),
birthplaces, age, and style of art.”
• “For each piece of artwork, the artist, the year it
was made, its unique title, its type of art … and its
price must be stored.”
Exercise 2
Solution
• “Pieces of artwork are also classified into groups of
various kinds, … Each group is identified by a name
(like those just given) that describes the group. “
• For each customer, galleries keep that person’s
unique name, address, total amount of dollars
spent in the gallery (very important!), and the artists
and groups of art that the customer tends to like.
Exercise 2
Solution
Exercise 2
Solution
• Now we look at constraints.
o Although not explicitly mentioned in the problem, we assume that each
piece of artwork had to be painted by an artist.
o We also assume that each piece of artwork was created by exactly one
artist.
Exercise 2
Solution
• Suppose we had several piece of artwork with the
same title, and we told them apart by artist?
• Example: “What is Love?” by Cheryl D, “What is
Love?” by Joe Brown, etc.

More Related Content

PPTX
Erd examples
PPT
Entity relationship diagram (erd)
PPTX
ER Modeling and Introduction to RDBMS
PPTX
Entity Relationship Diagrams
PPTX
Er diagrams presentation
PPTX
Er diagram
PPTX
Entity Relationship Model
PPT
Data modeling using the entity relationship model
Erd examples
Entity relationship diagram (erd)
ER Modeling and Introduction to RDBMS
Entity Relationship Diagrams
Er diagrams presentation
Er diagram
Entity Relationship Model
Data modeling using the entity relationship model

What's hot (20)

PPTX
Relational Data Model Introduction
PDF
Business Rules in Databases
PPTX
Mapping Cardinalities
PPTX
The Relational Model
PPT
15. Transactions in DBMS
PPTX
Data Modeling PPT
PPTX
joins in database
PPTX
Matching techniques
PPTX
Client server architecture
PPTX
And or graph
PPTX
Greedy Algorithm - Knapsack Problem
PPTX
object oriented methodologies
PPTX
Relational model
PPT
Entity relationship modelling
PPTX
ER model to Relational model mapping
PPTX
Application Layer
PPTX
Data Integration and Transformation in Data mining
PPT
Dbms relational model
PPT
Relational algebra in dbms
PPTX
Object oriented database concepts
Relational Data Model Introduction
Business Rules in Databases
Mapping Cardinalities
The Relational Model
15. Transactions in DBMS
Data Modeling PPT
joins in database
Matching techniques
Client server architecture
And or graph
Greedy Algorithm - Knapsack Problem
object oriented methodologies
Relational model
Entity relationship modelling
ER model to Relational model mapping
Application Layer
Data Integration and Transformation in Data mining
Dbms relational model
Relational algebra in dbms
Object oriented database concepts
Ad

Similar to Erd practice exercises (20)

PPTX
entityrelationshipdiagram & SQL Practice Exercises II.pptx
PPTX
entityrelationshipdiagrams & SQL Practice Exercises.pptx
PDF
Comprehensive Guide to Effective ER Diagram Principles
PPTX
13. case study
PDF
Exercise 2.1 Explain the accompanying terms quickly trait, space, e.pdf
PPTX
Data and functional modeling
PPTX
Entity Relationship Diagram Exercises.pptx
PDF
RDBMS ERD Examples
PPTX
IT6701 Information Management Unit-I
PPT
ERD_01B=DBMS DATA BASE MANAGEMENT SYSTEM.ppt
PDF
DATABASE DESIGNS ER DIAGRAMS REATIONA; ALGEBRA
PDF
Relational data base and Er diagema Normalization
PPT
databases3b
PPTX
Introduction To Database Design.pptx
PPT
databases2
PPTX
Lecture 2.5 ER Diagram and practice in DB.pptx
PPT
Unit 02 dbms
PPTX
Ass_01_2020.pptx
PPTX
ER modeling
PDF
Hands-On Database 2nd Edition Steve Conger Solutions Manual
entityrelationshipdiagram & SQL Practice Exercises II.pptx
entityrelationshipdiagrams & SQL Practice Exercises.pptx
Comprehensive Guide to Effective ER Diagram Principles
13. case study
Exercise 2.1 Explain the accompanying terms quickly trait, space, e.pdf
Data and functional modeling
Entity Relationship Diagram Exercises.pptx
RDBMS ERD Examples
IT6701 Information Management Unit-I
ERD_01B=DBMS DATA BASE MANAGEMENT SYSTEM.ppt
DATABASE DESIGNS ER DIAGRAMS REATIONA; ALGEBRA
Relational data base and Er diagema Normalization
databases3b
Introduction To Database Design.pptx
databases2
Lecture 2.5 ER Diagram and practice in DB.pptx
Unit 02 dbms
Ass_01_2020.pptx
ER modeling
Hands-On Database 2nd Edition Steve Conger Solutions Manual
Ad

More from Jennifer Polack (20)

PPTX
Catalogued and student workers database(use cases diagram)
PPTX
Trainer use cases
PPTX
Umw training program
PPTX
Classroom scheduler update
PPTX
Temperature data analyzer requirements
PPTX
Training Programming Description- Morning Section
PPTX
Training Programming Description- Afternoon Section
PDF
Cataloged and student workers database
PPTX
Temperature Analyzer Project
PPT
Database design
PPTX
System Modelling
PPTX
Software process
PPTX
Agile software process
PPTX
What is software engineering
PPTX
Requirements engineering
PPTX
Chapter 11
PPTX
Chapter 10
PPTX
Chapter 9
PPTX
Ccsc 2015 panel
PPTX
Chapter 8
Catalogued and student workers database(use cases diagram)
Trainer use cases
Umw training program
Classroom scheduler update
Temperature data analyzer requirements
Training Programming Description- Morning Section
Training Programming Description- Afternoon Section
Cataloged and student workers database
Temperature Analyzer Project
Database design
System Modelling
Software process
Agile software process
What is software engineering
Requirements engineering
Chapter 11
Chapter 10
Chapter 9
Ccsc 2015 panel
Chapter 8

Recently uploaded (20)

PDF
01-Introduction-to-Information-Management.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
Institutional Correction lecture only . . .
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Classroom Observation Tools for Teachers
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
master seminar digital applications in india
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Pre independence Education in Inndia.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
01-Introduction-to-Information-Management.pdf
human mycosis Human fungal infections are called human mycosis..pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Supply Chain Operations Speaking Notes -ICLT Program
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
RMMM.pdf make it easy to upload and study
Institutional Correction lecture only . . .
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Abdominal Access Techniques with Prof. Dr. R K Mishra
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Classroom Observation Tools for Teachers
Final Presentation General Medicine 03-08-2024.pptx
master seminar digital applications in india
TR - Agricultural Crops Production NC III.pdf
Cell Types and Its function , kingdom of life
Pre independence Education in Inndia.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...

Erd practice exercises

  • 2. Exercise 1 Problem • A company database needs to store information about employees (identified by ssn, with salary and phone as attributes), departments (identified by dno, with dname and budget as attributes), and children of employees (with name and age as attributes).
  • 3. Exercise 1 Problem • Employees work in departments; each department is managed by an employee; a child must be identified uniquely by name when the parent (who is an employee; assume that only one parent works for the company) is known. We are not interested in information about a child once the parent leaves the company. • Draw an ER diagram that captures this information.
  • 4. Exercise 1 Solution • First, we shall design the entities and relationships. o “Employees work in departments…” o “…each department is managed by an employee…” o “…a child must be identified uniquely by name when the parent (who is an employee; assume that only one parent works for the company) is known.”
  • 6. Exercise 1 Solution o “…each department is managed by an employee…” o “…a child must be identified uniquely by name when the parent (who is an employee; assume that only one parent works for the company) is known. “ o “We are not interested in information about a child once the parent leaves the company.”
  • 7. Exercise 2 Problem • Although you always wanted to be an artist, you ended up being an expert on databases because you love to cook data and you somehow confused database with data baste. Your old love is still there, however, so you set up a database company, ArtBase, that builds a product for art galleries. The core of this product is a database with a schema that captures all the information that galleries need to maintain.
  • 8. Exercise 2 Problem • Galleries keep information about artists, their names (which are unique), birthplaces, age,and style of art. For each piece of artwork, the artist, the year it was made, its unique title, its type of art (e.g., painting, lithograph, sculpture, photograph), and its price must be stored. Pieces of artwork are also classified into groups of various kinds, for example, portraits, still lifes, works by Picasso, or works of the 19th century; a given piece may belong to more than one group.
  • 9. Exercise 2 Problem • Each group is identified by a name (like those just given) that describes the group. Finally, galleries keep information about customers. For each customer, galleries keep that person’s unique name, address, total amount of dollars spent in the gallery (very important!), and the artists and groups of art that the customer tends to like. • Draw the ER diagram for the database.
  • 10. Exercise 2 Solution • Like before, we begin with the entities and relationships. • “…artists, their names (which are unique), birthplaces, age, and style of art.” • “For each piece of artwork, the artist, the year it was made, its unique title, its type of art … and its price must be stored.”
  • 11. Exercise 2 Solution • “Pieces of artwork are also classified into groups of various kinds, … Each group is identified by a name (like those just given) that describes the group. “ • For each customer, galleries keep that person’s unique name, address, total amount of dollars spent in the gallery (very important!), and the artists and groups of art that the customer tends to like.
  • 13. Exercise 2 Solution • Now we look at constraints. o Although not explicitly mentioned in the problem, we assume that each piece of artwork had to be painted by an artist. o We also assume that each piece of artwork was created by exactly one artist.
  • 14. Exercise 2 Solution • Suppose we had several piece of artwork with the same title, and we told them apart by artist? • Example: “What is Love?” by Cheryl D, “What is Love?” by Joe Brown, etc.