Consider the following EER diagram. Map it into a relational database schema. Hi
ID: 668786 • Letter: C
Question
Consider the following EER diagram. Map it into a relational database schema. Hint: Do not forget to add UNIQUE and NOT NULL in the schema where they needed.
Note: For simplicity, the domain for each attribute can be omitted in the schema.
The database schema should use the following format for each table:
Relation_name (attribute name list), PK: ..., FK (if any): ... references ..., UNIQUE, NOT NULL
For example:
Project (ProjectNo, ProjectName), PK: ProjectNo.
Employee (EmployeeNo, Name, WorksOn), PK: ProjectNo, FK: WorksOn references Project, Workson: UNIQUE, NOT NULL.
* Assume that workson is a 1:1 total relationship for Employee between Employee and Project.
sign Customer pid price buy Product titled ISBN )( title )page number Author Customer year Movie Book write HardcoverAudiobook Paperback Author SSN lastExplanation / Answer
-----------------------------------------
Entities present in the ER-Model are:
-----------------------------------------
Each entity represents a table.
--------------------------------
1. Author
--------------------------------
SSN - primary_key
name -
first -
last -
Author(SSN,name,first,last)
--------------------------------
2. Book
--------------------------------
ISBN - primary_key
title -
page_number -
SSN - foriegn_key works on references (Author)
pid - foriegn_key works on references (Product)
Book(ISBN,title,page_number,SSN,pid)
--------------------------------
3. Handcover
--------------------------------
id - primary_key
ISBN - foriegn_key works on references (Book)
Handcover(id,ISBN)
--------------------------------
4. Audiobook
--------------------------------
id - primary_key
ISBN - foriegn_key works on references (Book)
Audiobook(id,ISBN)
--------------------------------
5. Paperback
--------------------------------
id - primary_key
ISBN - foriegn_key works on references (Book)
Paperback(id,ISBN)
--------------------------------
6. Movie
--------------------------------
title - primary_key
director-
year -
pid - foriegn_key works on references (Product)
Movie(title,director,year,pid)
--------------------------------
7. Product
--------------------------------
pid - primary_key
price -
Product(pid,price)
--------------------------------
8. Customer
--------------------------------
cid - primary_key
sign_date
pid - foriegn_key works on references (Product)
Customer(cid,sign_date,pid)
--------------------------------
9. Author Customer
--------------------------------
author_id - primary_key
discount -
cid - foriegn_key works on references (Customer)
SSN - foriegn_key works on references (Author)
Author_Customer(author_id,discount,cid,SSN)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.