Middle+
You need to describe the library model. There are 3 entities: "Author", "Book", "Reader". Physically, there is only one book and it can only belong to one reader. You need to create tables for the library to account for this.
sobes.tech AI
Answer from AI
To describe a library model with entities "Author", "Book", "Reader" and the condition that each book physically exists as a single copy and can only be with one reader at a time, the following tables can be used:
- Author
id(PK)name
- Book
id(PK)titleauthor_id(FK to Author.id)reader_id(FK to Reader.id, nullable)
- Reader
id(PK)name
Explanation:
- Each book is linked to one author via
author_id. - The
reader_idfield in the book table indicates which reader currently has the book. If the book is not issued, this field will be NULL.
This ensures that each book exists as a single copy and can only be with one reader at a time.