10 Database and file concepts (3)

Resources | Revision Questions | Information Technology IT

Login to see all questions

Click on a question to view the answer

1.

Question 3

A university is creating a database to manage student records. The students table contains columns for student_id (integer, primary key), student_name (text), course_id (integer, foreign key referencing the courses table), and grade (text). The courses table contains columns for course_id (integer, primary key) and course_name (text). Write SQL queries to:

  1. Create the students table.
  2. Update the course a student is enrolled in.
  3. Delete a student from the students table if they are no longer enrolled in any courses.
```
2.

Question 2

A database for a library has the following table:

BookIDTitleAuthorISBNPublisher

Identify any violations of 3NF in this table. Describe how you would normalize it to 3NF. Explain the reasoning behind your normalization steps.

3.

A library database needs to store information about books and authors. Each book is written by exactly one author, and an author can write multiple books. Describe, using appropriate terminology, the type of database relationship that should be used to model this scenario. Explain why this relationship type is suitable and what benefits it provides in terms of data integrity and efficiency.