Ch 8 Database Questions
Ch 8 Database Questions
Database Concepts
(Total: 9 marks)
(c) Explain how a relational database overcomes one of these limitations. (5 marks)
Q2. Relational Databases
(Total: 9 marks)
(c) Consider the table STUDENT(StudentID, Name, Age, ClassID). Identify the primary
key and foreign key, if any. (4 marks)
Q3. Keys in a Database
(Total: 9 marks)
(b) Explain the difference between a primary key and a foreign key. (3 marks)
If EmpID and Email are both unique, list the candidate keys. (2 marks)
Identify a possible foreign key in this table. (2 marks)
Q4. Normalisation
(Total: 9 marks)
(Total: 9 marks)
(a) Write an SQL query to create a table called PRODUCT with attributes ProductID (integer,
primary key) and ProductName (text). (3 marks)
(b) Write an SQL query to insert a new record into PRODUCT with ProductID = 101 and
ProductName = 'Laptop'. (2 marks)
(c) Write an SQL query to select all products where the name contains 'Phone'. (4 marks)
Q6. Database Management System (DBMS)
(Total: 9 marks)
(Total: 9 marks)
(c) Consider a table with 100,000 records. Without indexing, searching takes 5 seconds.
With indexing, it takes 1 second. Explain why this happens. (4 marks)
Q8. Entity-Relationship Diagrams (ERD)
(Total: 9 marks)