DOC PREVIEW
Berkeley COMPSCI 186 - E-R Exercise

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1Slide 2E-R ExerciseA 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.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, PlaceFor 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


View Full Document

Berkeley COMPSCI 186 - E-R Exercise

Documents in this Course
Load more
Download E-R Exercise
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view E-R Exercise and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view E-R Exercise 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?