AUTHOR
table
Author_ID
, PK First_Name
Last_Name
TITLES
table
TITLE_ID
, PK NAME
Author_ID
, FK DOMAIN
table
DOMAIN_ID
, PK NAME
TITLE_ID
, FK READERS
table
READER_ID
, PK First_Name
Last_Name
ADDRESS
CITY_ID
, FK PHONE
CITY
table
CITY_ID
, PK NAME
BORROWING
table
BORROWING_ID
,pk READER_ID
, fk TITLE_ID
, fk DATE
HISTORY
table
READER_ID
TITLE_ID
DATE_OF_BORROWING
DATE_OF_RETURNING
This looks a bit like a homework problem, but let me answer anyway:
I would change the Titles to a MANY-TO-MANY, and leave the addresses.
TITLES
table
TITLE_ID
, PK NAME
TitleAutors
table
TITLE_ID
, AUTHOR_ID
You could change the BORROWING table to have the status of the entry (OUT, IN, MISSING, UNKNOWN) and have a STATUS_DATE.
How do you expect anybody to seriously answer this question without any knowledge of your business domain ?
In order to answer this question earnestly, one needs to know the entire set of functional dependencies that govern your data, and you have not provided those.
For your scheme to be in 3NF, for example, it would require that domainID -> titleID, or, in other words, that there is only one title for each domain, and that knowing the domain implies that you can know the title. On the face of it, that seems curious, but the only one who can tell for sure whether or not this is an accurate representation of the business reality that you're dealing with, is you.
An additional thought that occurred to me after reading others comments is.
If so you may have redundant first and last names entered into your system, and it would be susceptible to update anomalies. For example if Jane Smith was a reader and an author and got married and her Surname changed to Williams then the possibility for updating her Reader last name and not her author last name would exist.
You would fix this by perhaps creating a User table where you have two Foreign keys for a Authors and Readers Table. Just a thought... ;)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.