slide1 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
E-R Exercise A Company database needs to store information about: employees (identified by ssn , with salary and ph PowerPoint Presentation
Download Presentation
E-R Exercise A Company database needs to store information about: employees (identified by ssn , with salary and ph

Loading in 2 Seconds...

play fullscreen
1 / 2

E-R Exercise A Company database needs to store information about: employees (identified by ssn , with salary and ph - PowerPoint PPT Presentation


  • 438 Views
  • Uploaded on

E-R Exercise 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 ), children of employees (with name and age as attributes).

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'E-R Exercise A Company database needs to store information about: employees (identified by ssn , with salary and ph' - LeeJohn


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1

E-R Exercise

  • 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),
    • children of employees (with name and age as attributes).
  • Employees work in departments, every department is managed by a single employee, a child must be identified uniquely by its 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 if the parent leaves the company (and is removed from the database).
  • Draw an ER diagram that captures this information.
slide2

Given the following ER diagram describing a record company’s database, how would you convert it to relational schemas? Describe what tables you would create, and what fields they would have. You can write in English, you don’t have to use SQL DDL.

As discussed in class, the following entities become relations:

Instrument, Musician, Song, Album, Place

For relationships, Plays is many-to-many, it becomes a relation. The same is true for the Perform and Lives relationships.

Every song must appear on only one Album, so the Songs relation will just have a non-null foreign key to Album.

Similarly, every Album is produced by only one musician, so the Album relation will have a non-null foreign key to Musician.

Phone is more complicated. I would probably just have a table with address and phone, to indicate all the phones for each address.