🎓 CS340 Database Systems

Comprehensive Final Examination

Course Code
CS340
Total Points
100
Total Questions
30
Duration
180 min
⏱️ 00:00:00
Your Progress 0/30 answered
📋 Multiple Choice Questions 25 marks
Q1 2.5 marks
Choose the steps for designing and implementing a database in the correct order:
  1. Create your own application
  2. Decide how to query
  3. Logical modeling
  4. Conceptual modeling
  5. Optimize the design
Q2 2.5 marks
Storing the same data in many places is called:
Q3 2.5 marks
Which enables users to modify data structures without affecting existing programs?
Q4 2.5 marks
What is TRUE about the Conceptual level?
Q5 2.5 marks
Which architecture is common for web applications?
Q6 2.5 marks
Which ACID property ensures committed changes persist despite failures?
Q7 2.5 marks
A weak entity type always has _______ participation with its identifying relationship.
Q8 2.5 marks
Which offers the ability to query and manipulate data?
Q9 2.5 marks
What is the primary function of a foreign key?
Q10 2.5 marks
If every non-key attribute is functionally dependent on the primary key, the relation is in:
✍️ Written Questions 40 marks
Q11 10 marks
Given the following schema, identify all foreign keys and explain their role in maintaining referential integrity:

Restaurant (restaurantId, restaurantName, restaurantAddress, restaurantCity)
Customer (customerId, customerName, customerAddress, customerCity)
Reservation (customer_id, restaurant_id, reservationDate, noOfPersons)
Q12 10 marks
Explain First Normal Form (1NF) and describe violations that prevent a relation from being in 1NF.
Q13 10 marks
Explain Second Normal Form (2NF) and the type of functional dependency that must be eliminated.
Q14 10 marks
Explain Third Normal Form (3NF) and what must be eliminated to achieve it.
💻 SQL Queries 20 marks
Q15 10 marks
Write a SQL query to find customers who have placed orders totaling more than $500.
Schema: Customers (CustomerID, Name), Orders (OrderID, CustomerID, TotalAmount)
Q16 10 marks
Write SQL queries to:
1. List all unique cities where customers live
2. Insert a new customer
3. Update a customer's address
📐 Normalization Problems 15 marks
Q17 15 marks
Normalize the LIBRARY relation to 3NF:

LIBRARY (Branch#, Branch_Addr, ISBN, Title, Author, Pub_ID, Pub_Name, Pub_Address, Num_copies)

FD1: Branch# → Branch_Addr
FD2: ISBN → Title, Author, Pub_ID
FD3: Pub_ID → Pub_Name, Pub_Address
FD4: (ISBN, Branch#) → Num_copies

Show all steps and final relations.

🎉 Your Exam Results

0/100
Multiple Choice
0/25
Written Questions
0/40
SQL Queries
0/20
Percentage
0%