Course Name: Database Management Systems Time Allowed: 1.5 Hours | Max Marks: 40 Instructions:
- All questions are compulsory.
- Figures to the right indicate full marks.
- Assume suitable valid data wherever required.
a) Explain the Three-Schema Architecture in a DBMS. How does this architecture help in achieving Logical and Physical Data Independence? (5M)
b) Define the concepts of Entity Integrity and Referential Integrity constraints in the relational model. Explain with a suitable example demonstrating primary and foreign keys. (5M)
a) Consider the University Management System ER model provided in the diagram below. Convert this ER model into the most appropriate Relational Model.
- Show the step-by-step reduction of the ER schema to tables.
- Clearly identify the Primary Keys, Foreign Keys, and how you handled composite, multivalued, and derived attributes.
- Prepare the final Schema Diagram for the same. (10M)
b) Explain the Extended E-R features of Generalization and Specialization. Give an example demonstrating the difference between total-partial and overlap-disjoint constraints. (5M)
a) Consider the following relational database schema:
- Employee (Emp_ID, EName, Salary, Dept_ID)
- Department (Dept_ID, DName, Location) (Note: Primary keys are underlined)
Write SQL commands for the following operations: (10M)
- DDL: Write the
CREATE TABLEstatement for theEmployeetable, strictly enforcing the Primary Key and establishingDept_IDas a Foreign Key referencing theDepartmenttable. - Nested Query: Display the names of employees who earn a salary strictly greater than the average salary of all employees in the company.
- Joins & Aggregate: Find the total number of employees working in the 'Research' department.
- Views: Create a View named
High_Earnersthat displays theENameandSalaryof all employees earning more than Rs. 85,000. - Update: Using a single
UPDATEcommand, increase the salary of all employees by 10% only if they work in the 'Mumbai' location.
b) What are the common pitfalls in relational database design? Explain the concept of Functional Dependencies and Lossless Decomposition with a brief example to show how Normal Forms (up to 3NF) address these pitfalls. (5M)
End of Paper
Here is the complete Answer Key and Marking Scheme for the 40-mark Database Management Systems Mid-Semester paper.
ANSWER KEY & MARKING SCHEME
Course Name: Database Management Systems | Max Marks: 40
Q.1 Answer the following questions (10 Marks)
a) Three-Schema Architecture & Data Independence (5M)
b) Entity Integrity and Referential Integrity (5M)
Student (RollNo PK, Name)->RollNocannot be NULL (Entity Integrity).Enrollment (EnrollID PK, RollNo FK)-> TheRollNoinEnrollmentMUST exist in theStudenttable or be NULL (Referential Integrity).Q.2 Entity-Relationship Model and Mapping (15 Marks)
a) ER to Relational Model Conversion (University Database) (10M)
Professor (Prof_Id PK, First_Name, Last_Name)Course (Course_Code PK, Title, Credits)Student (Stud_Id PK, DOB, City, State)Prof_Expertise (Prof_Id FK, Expertise)-> Composite PK: (Prof_Id, Expertise)Course (Course_Code PK, Title, Credits, Prof_Id FK)Enrolled_in (Course_Code FK, Stud_Id FK)-> Composite PK: (Course_Code, Stud_Id)b) Extended ER Features & Constraints (5M)
Employeegeneralizing intoFacultyandStaffis Disjoint (can't be both) and Total (every employee must be one of the two).Q.3 SQL Queries and Relational Design (15 Marks)
a) SQL Queries (10 Marks - 2 Marks per correct query)
(Deduct 0.5 marks for minor syntax errors like missing semicolons or typos; deduct 1-2 marks for logical errors)
1. DDL (Create Table with PK & FK):
2. Nested Query (Salary > Average):
3. Joins & Aggregate (Count in 'Research'):
(Accept subquery logic:
SELECT COUNT(*) FROM Employee WHERE Dept_ID = (SELECT Dept_ID FROM Department WHERE DName = 'Research');)4. Views (High_Earners):
5. Update (Increase salary in 'Mumbai'):
b) Pitfalls, Functional Dependencies, and Normalization (5M)