SlideShare une entreprise Scribd logo
1  sur  14
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.

Contenu connexe

Tendances

Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Jargalsaikhan Alyeksandr
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagramssadique_ghitm
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra pptGirdharRatne
 
Library management system
Library management systemLibrary management system
Library management systemashu6
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMSkoolkampus
 
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...vtunotesbysree
 
Solution manual for database systems a practical approach to design implement...
Solution manual for database systems a practical approach to design implement...Solution manual for database systems a practical approach to design implement...
Solution manual for database systems a practical approach to design implement...zammok
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramShakila Mahjabin
 
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAINFP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAINSyahriha Ruslan
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 
Normalization of database tables
Normalization of database tablesNormalization of database tables
Normalization of database tablesDhani Ahmad
 
Course registration system
Course registration systemCourse registration system
Course registration systemHuda Seyam
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFBiplap Bhattarai
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries LectureFelipe Costa
 
Data structure and algorithm using java
Data structure and algorithm using javaData structure and algorithm using java
Data structure and algorithm using javaNarayan Sau
 

Tendances (20)

Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
Normalisation
NormalisationNormalisation
Normalisation
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
Library management system
Library management systemLibrary management system
Library management system
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMS
 
Dbms lab questions
Dbms lab questionsDbms lab questions
Dbms lab questions
 
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
 
Solution manual for database systems a practical approach to design implement...
Solution manual for database systems a practical approach to design implement...Solution manual for database systems a practical approach to design implement...
Solution manual for database systems a practical approach to design implement...
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAINFP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Normalization of database tables
Normalization of database tablesNormalization of database tables
Normalization of database tables
 
Course registration system
Course registration systemCourse registration system
Course registration system
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries Lecture
 
Data structure and algorithm using java
Data structure and algorithm using javaData structure and algorithm using java
Data structure and algorithm using java
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
Database Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal GulatiDatabase Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal Gulati
 

Similaire à Erd practice exercises

Components of an Art Critique_Contemporary Phi. Arts
Components of an Art Critique_Contemporary Phi. ArtsComponents of an Art Critique_Contemporary Phi. Arts
Components of an Art Critique_Contemporary Phi. Artshannahruthpayao1
 
Year 7 ceramics families are unique totem-2020 wd
Year 7 ceramics  families are unique totem-2020 wdYear 7 ceramics  families are unique totem-2020 wd
Year 7 ceramics families are unique totem-2020 wdJulietteWegdam1
 
Marketing Workshop 2 Powerpoint Festivals, Pricing And Presentation
Marketing Workshop 2 Powerpoint  Festivals, Pricing And PresentationMarketing Workshop 2 Powerpoint  Festivals, Pricing And Presentation
Marketing Workshop 2 Powerpoint Festivals, Pricing And PresentationFresh Arts
 
Chapter Four Art Criticism
Chapter Four Art CriticismChapter Four Art Criticism
Chapter Four Art Criticismtaraballenger
 
KCC Art 211 Ch 5 Critiquing Art
KCC Art 211 Ch 5 Critiquing ArtKCC Art 211 Ch 5 Critiquing Art
KCC Art 211 Ch 5 Critiquing ArtKelly Parker
 
Limacon 2014 CC Algebra Activities
Limacon 2014 CC Algebra ActivitiesLimacon 2014 CC Algebra Activities
Limacon 2014 CC Algebra Activitiesereiser
 

Similaire à Erd practice exercises (14)

Ap art
Ap artAp art
Ap art
 
Components of an Art Critique_Contemporary Phi. Arts
Components of an Art Critique_Contemporary Phi. ArtsComponents of an Art Critique_Contemporary Phi. Arts
Components of an Art Critique_Contemporary Phi. Arts
 
Conceptualizing
ConceptualizingConceptualizing
Conceptualizing
 
Surrealismproject
SurrealismprojectSurrealismproject
Surrealismproject
 
Year 7 ceramics families are unique totem-2020 wd
Year 7 ceramics  families are unique totem-2020 wdYear 7 ceramics  families are unique totem-2020 wd
Year 7 ceramics families are unique totem-2020 wd
 
Label work why
Label work whyLabel work why
Label work why
 
Zp term 1
Zp term 1Zp term 1
Zp term 1
 
Marketing Workshop 2 Powerpoint Festivals, Pricing And Presentation
Marketing Workshop 2 Powerpoint  Festivals, Pricing And PresentationMarketing Workshop 2 Powerpoint  Festivals, Pricing And Presentation
Marketing Workshop 2 Powerpoint Festivals, Pricing And Presentation
 
Opencall rules
Opencall rulesOpencall rules
Opencall rules
 
Chapter Four Art Criticism
Chapter Four Art CriticismChapter Four Art Criticism
Chapter Four Art Criticism
 
Wartime Marketing 1942 Smithsonian
Wartime Marketing 1942 SmithsonianWartime Marketing 1942 Smithsonian
Wartime Marketing 1942 Smithsonian
 
KCC Art 211 Ch 5 Critiquing Art
KCC Art 211 Ch 5 Critiquing ArtKCC Art 211 Ch 5 Critiquing Art
KCC Art 211 Ch 5 Critiquing Art
 
Limacon 2014 CC Algebra Activities
Limacon 2014 CC Algebra ActivitiesLimacon 2014 CC Algebra Activities
Limacon 2014 CC Algebra Activities
 
Art Criticism Instructions
Art Criticism InstructionsArt Criticism Instructions
Art Criticism Instructions
 

Plus de Jennifer Polack

Catalogued and student workers database(use cases diagram)
Catalogued and student workers database(use cases diagram)Catalogued and student workers database(use cases diagram)
Catalogued and student workers database(use cases diagram)Jennifer Polack
 
Classroom scheduler update
Classroom scheduler updateClassroom scheduler update
Classroom scheduler updateJennifer Polack
 
Temperature data analyzer requirements
Temperature data analyzer requirementsTemperature data analyzer requirements
Temperature data analyzer requirementsJennifer Polack
 
Training Programming Description- Morning Section
Training Programming Description- Morning SectionTraining Programming Description- Morning Section
Training Programming Description- Morning SectionJennifer Polack
 
Training Programming Description- Afternoon Section
Training Programming Description- Afternoon SectionTraining Programming Description- Afternoon Section
Training Programming Description- Afternoon SectionJennifer Polack
 
Cataloged and student workers database
Cataloged and student workers databaseCataloged and student workers database
Cataloged and student workers databaseJennifer Polack
 
Temperature Analyzer Project
Temperature Analyzer ProjectTemperature Analyzer Project
Temperature Analyzer ProjectJennifer Polack
 
What is software engineering
What is software engineeringWhat is software engineering
What is software engineeringJennifer Polack
 
Requirements engineering
Requirements engineeringRequirements engineering
Requirements engineeringJennifer Polack
 

Plus de Jennifer Polack (20)

Catalogued and student workers database(use cases diagram)
Catalogued and student workers database(use cases diagram)Catalogued and student workers database(use cases diagram)
Catalogued and student workers database(use cases diagram)
 
Trainer use cases
Trainer use casesTrainer use cases
Trainer use cases
 
Umw training program
Umw training programUmw training program
Umw training program
 
Classroom scheduler update
Classroom scheduler updateClassroom scheduler update
Classroom scheduler update
 
Temperature data analyzer requirements
Temperature data analyzer requirementsTemperature data analyzer requirements
Temperature data analyzer requirements
 
Training Programming Description- Morning Section
Training Programming Description- Morning SectionTraining Programming Description- Morning Section
Training Programming Description- Morning Section
 
Training Programming Description- Afternoon Section
Training Programming Description- Afternoon SectionTraining Programming Description- Afternoon Section
Training Programming Description- Afternoon Section
 
Cataloged and student workers database
Cataloged and student workers databaseCataloged and student workers database
Cataloged and student workers database
 
Temperature Analyzer Project
Temperature Analyzer ProjectTemperature Analyzer Project
Temperature Analyzer Project
 
Database design
Database designDatabase design
Database design
 
System Modelling
System ModellingSystem Modelling
System Modelling
 
Software process
Software processSoftware process
Software process
 
Agile software process
Agile software processAgile software process
Agile software process
 
What is software engineering
What is software engineeringWhat is software engineering
What is software engineering
 
Requirements engineering
Requirements engineeringRequirements engineering
Requirements engineering
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Ccsc 2015 panel
Ccsc 2015 panelCcsc 2015 panel
Ccsc 2015 panel
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 

Dernier

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Dernier (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

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.