Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
Entity relationship diagram (erd)
Next
Download to read offline and view in fullscreen.

25

Share

Download to read offline

Erd practice exercises

Download to read offline

ERD

Related Books

Free with a 30 day trial from Scribd

See all

Erd practice exercises

  1. 1. ERD Practice Exercises Database Design
  2. 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. 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. 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.”
  5. 5. Exercise 1 Solution
  6. 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. 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. 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. 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. 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. 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.
  12. 12. Exercise 2 Solution
  13. 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. 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.
  • ShephaliJain3

    Jun. 24, 2021
  • VishSaxena3

    Dec. 19, 2020
  • HassanBae

    Aug. 5, 2020
  • REYJEANMORDICE

    Apr. 19, 2020
  • PhuongHoney

    Aug. 27, 2019
  • AndyLaura

    Jan. 31, 2019
  • NayanikaDutt

    Dec. 7, 2018
  • EsraaFadlun

    Nov. 9, 2018
  • MuhammadAhmad2000

    Oct. 16, 2018
  • HamzaHameed8

    Sep. 5, 2018
  • EhabKhatab1

    Apr. 16, 2018
  • Dewanshu123

    Feb. 18, 2018
  • FarihaAshraf2

    Nov. 13, 2017
  • ReyandaFajarNurcahyo

    Nov. 1, 2017
  • AakarshitaTiwari

    Sep. 12, 2017
  • deraedta

    Sep. 2, 2017
  • BarbaraWilliams64

    Jul. 23, 2017
  • RonenZysman

    Jul. 10, 2017
  • ccjun

    Jun. 18, 2017
  • MNaumanTishna

    Apr. 4, 2017

ERD

Views

Total views

57,752

On Slideshare

0

From embeds

0

Number of embeds

81

Actions

Downloads

1,699

Shares

0

Comments

0

Likes

25

×