Databases Reference
In-Depth Information
the unique identifier. The attribute Quantity is intersection data in the many-to-many
relationship and so becomes an attribute in the associative entity SALES that links
salespersons with the products they have sold in a many-to-many relationship.
EXAMPLE: GOOD READING BOOK STORES
Figure 2.10 shows the E-R diagram for Good Reading Bookstores. Good Reading
is a chain of bookstores that wants to keep track of the topics that it sells, their
publishers, their authors, and the customers who buy them. The topic entity has
four attributes. Book Number is the unique identifier. A book has exactly one
publisher. Publisher Name is the unique identifier of the PUBLISHER entity. A
publisher may have (and generally has) published many books that Good Reading
carries; however, Good Reading also wants to be able to keep track of some
publishers that currently have no books in Good Reading's inventory (note the
zero-modality symbol from PUBLISHER towards BOOK). A book must have at
least one author but can have many (where in this case ''many'' means a few,
generally two or three at most). For a person to be of interest to Good Reading
as an author, she must have written at least one and possibly many books that
Good Reading carries. Note that there is a many-to-many relationship between the
PUBLISHER
PK
BOOK
WROTE
Publisher
Name
PK
Book
Number
PK
Book
Number
Published
Published by
Written by
PK
Author
Number
City
Country
President
Year Founded
Book Name
Publication
Year
Pages
Wrote
Sold
In sale
Wrote
Written by
SALE
CUSTOMER
PK
AUTHOR
PK
Book
Number
Customer
Number
PK
Author
Number
Bought
Bought by
PK
Customer
Number
Customer
Name
Street
City
State
Country
Author Name
Year Born
Year Died
Date
Price
Quantity
F IGURE 2.10
Good Reading Bookstores entity-relationship diagram
Search WWH ::




Custom Search