In: Computer Science
Consider the following ER diagram, which models an online bookstore.
As per the attached picture in the attached link :
https://www.google.com/imgres?imgurl=https://media.cheggcdn.com/study/45a/45a5708f-f2b8-4864-99a3-284d8c13e235/5924-7-20EEI1.png&imgrefurl=https://www.chegg.com/homework-help/consider-e-r-diagram-figure-729-models-online-bookstore-lis-chapter-7-problem-20e-solution-9780073523323-exc&tbnid=q173_TY0HXF25M&vet=1&docid=hPpMlzEq8SYJYM&w=756&h=688&hl=en&source=sh/x/im
A. List the entity sets and their primary keys.
B. Map the ER to appropriate schema showing the different relations.
Question A:
Entity sets in the given Diagram :
1) Author entity set :
2) Publisher entity set:
3) book entity set :
4) Shopping_basket entity set
5) warehouse entity set
6) Customer entity set
Question B:
Map the ERD to relational schema :
1) There are one and more books written by one author so there are M:1 relationship between book and author so the PK of Author table is act as FK in Book table .
2) As one or more books are published by one publisher so there are M:1 relationship between book and publisher . so the PK of Publisher table act as FK in Book table
3) There are one or more books are contains in one or more Shopping_basket so there are M:N relationship between them. And for M:N relationship a different relation is create for them in which the PK of both table act as FK.
4) As one or more books are store in the stocks of one warehouse so there are M:1 relationship between Book and warehouse where the PK of warehouse act as FK in Book table.
5) There are one or more shopping basket is used by one customer so there are M:1 relationship between Shopping_basket and Customer . The PK of Customer table is used as FK in Shopping_basket table.
Note : Both name of author and publisher are written by same name
so I put the name of publisher by pub_name to
differentiate them.
ERD :
ERD Mapping:
Thank you.............