8.1 Database Concepts (3)

Resources | Revision Questions | Computer Science

Login to see all questions

Click on a question to view the answer

1.

Explain the difference between an Entity-Relationship Diagram (ERD) and a relational database schema. Describe the purpose of an ERD and provide an example of a simple ERD for a library database. Then, explain how a relational database schema is derived from an ERD.

2.

Question 2: Consider a database table called OrderDetails with the following attributes: OrderID (Primary Key), ProductID (Foreign Key referencing Products), Quantity, and UnitPrice. Explain how this table violates 3NF. Then, describe the steps required to decompose this table into two tables that are in 3NF. Include the primary and foreign keys for each new table.

3.

Question 1

A local library wants to design a database to manage its books, members, and loans. Describe an Entity-Relationship (E-R) diagram to model this system. Your diagram should clearly identify the entities, their attributes (including primary keys), and the relationships between them. Explain the cardinality and optionality of each relationship. Consider the following requirements:

  • Each book has a unique ISBN.
  • Each library member has a unique membership number.
  • A book can be borrowed by multiple members.
  • A member can borrow multiple books.
  • A book can be written by one or more authors.
  • A book can be of multiple genres.