0% found this document useful (0 votes)
21 views5 pages

MidTerm exam 1

The document outlines a mid-term exam for a Database Management course, focusing on library book management and database normalization. It includes tasks related to normalizing an unnormalized table to Third Normal Form (3NF), identifying candidate keys, and writing SQL queries for data retrieval. The exam is open-book and requires detailed explanations and diagrams for the normalization process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views5 pages

MidTerm exam 1

The document outlines a mid-term exam for a Database Management course, focusing on library book management and database normalization. It includes tasks related to normalizing an unnormalized table to Third Normal Form (3NF), identifying candidate keys, and writing SQL queries for data retrieval. The exam is open-book and requires detailed explanations and diagrams for the normalization process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

NATIONAL ECONOMICS UNIVERSITY SOCIALIST REPUBLIC OF VIETNAM

NEU-COLLEGE OF TECHNOLOY Independence – Freedom – Happiness

Mid-Term Exam
Course: Database management for business
Semester II, School Year 2024-2025
Time: 90 minutes
Code 1
Instructions:
 This is an open-book exam. Students may use their textbooks, printed notes, and written
materials.
 Write your answers clearly and show all steps for calculations and explanations.
Part 1: Database Normalization (60 points)
Problem: Library Book Management
You are tasked with designing a database for managing a library’s book inventory system. The
current table contains redundant and improperly organized data. Your job is to fix the database
by normalizing it to Third Normal Form (3NF).
Unnormalized Table:
Book Author Author Branch Branch
Book Title Genre Availability
ID ID Name ID Name

Main
B001 The Great Gatsby A001 F. Scott Fiction BR01 Available
Branch

To Kill a Main
B002 A002 Harper Lee Fiction BR01 Checked Out
Mockingbird Branch

A Brief History of Stephen West


B003 A003 Science BR02 Available
Time Hawking Branch

B004 1984 A001 F. Scott Fiction BR03 East Branch Available


Functional Dependencies:
1. Book ID → Book Title, Genre
2. Author ID → Author Name
3. Branch ID → Branch Name
4. Book ID, Branch ID → Availability
Tasks:
1. Candidate Keys (10 points)

o Identify the candidate keys for the unnormalized table.


2. Normalization Steps (20 points)

o Normalize the table from UNF to 1NF, 2NF, and 3NF.


3. Explain Normalization (15 points)

o Describe each step in detail, explaining how to fix issues such as duplicate data,
partial dependencies, and transitive dependencies.
4. Table Diagrams (10 points)

o Draw diagrams of the new tables and identify the Primary Keys.
5. Benefits of 3NF (5 points)

o Explain why normalization improves the database system.

Part 2: SQL Queries (40 points)


Write SQL Queries:
1. Inner Join Query (10 points)

o Write a query to display book titles, author names, genres, and availability using
INNER JOIN.
2. Left Join Query (10 points)

o Write a query using LEFT JOIN to show all books and their availability, even if
some branches have no records.
3. Multi-Table Join Query (10 points)

o Write a query that joins three tables to display book titles, author names, branch
names, and availability status.
4. Available Books Query (10 points)

o Write a query that returns only available books, showing their titles, genres, and
branch names.
Final Exam 6
Semester I, school year 2024-2025
(Time: 90 minutes)
1. Library Book Management – Database Normalization from an Unnormalized Table to
3NF
Problem: Library Book Management
You are tasked with designing a database for managing a library’s book inventory system. The
initial data is stored in an unnormalized table, which includes information about books, their
authors, book genres, and the library branch where each book is located.
However, this table is not normalized and contains several issues such as redundant information
and improper functional dependencies. Therefore, you need to normalize the database from the
unnormalized table to 3NF to optimize data storage and query performance.
Initial Table (Unnormalized Table):
Book ID Book Title Author ID Author Name Genre Branch ID Branch Name Availability
B001 The Great Gatsby A001 F. Scott Fiction BR01 Main Branch Available
B002 To Kill a Mockingbird A002 Harper Lee Fiction BR01 Main Branch Checked Out
Stephen
B003 A Brief History of Time A003 Science BR02 West Branch Available
Hawking
B004 1984 A001 F. Scott Fiction BR03 East Branch Available

Given Functional Dependencies:


1. Book ID -> Book Title, Genre

2. Author ID -> Author Name

3. Branch ID -> Branch Name

4. Book ID, Branch ID -> Availability

Requirements:
1. Identify the candidate keys of the initial table.
2. Normalize the table from UNF to 1NF, 2NF, and 3NF.
3. Describe the normalization steps in detail, explaining how to eliminate improper
functional dependencies, partial dependencies, and transitive dependencies.
4. Draw diagrams of the normalized tables (if possible) and identify the primary keys of the
sub-tables.
5. Explain the benefits of normalizing the database to 3NF for data management.

You might also like