FINAL EXAM IMPORTANT QUESTIONS FOR DBMS THEORY
Relational Algebra – Theory + MCQs + 10 Scenarios
SQL – Only Queries (20 Queries + 5 Scenarios)
ACID Transaction & Concurrency – Only Theory (from slides)
Basics of Excel & Power BI – Theory + 20 Excel Commands + Basic Formulas
1) RELATIONAL ALGEBRA
a) Define Relational Algebra. Why is it important in DBMS? (2 Marks)
b) Differentiate between selection (σ) and projection (π) operators. (3 Marks)
MCQs
1. Which relational algebra operator is used to rename attributes?
a) σ b) π c) ρ d) ×
2. The Cartesian Product operator returns:
a) Subset of rows
b) All possible combinations of tuples
c) Only matching tuples
d) None
3. Which operator corresponds to SQL JOIN?
a) Union
b) Intersection
c) Natural Join
d) Division
4. Which operator is commutative in relational algebra?
a) Union
b) Difference
c) Selection
d) All of the above
5. Division operator is mainly used for:
a) One-to-many relationships
b) Many-to-many relationships
c) Queries with “for all” conditions
d) None
Scenarios
Given relations:
Student(SID, SName, Dept, Age)
Course(CID, CName, Credits)
Enroll(SID, CID, Grade)
Perform the following using Relational Algebra:
1. Retrieve names of students older than 20 years.
2. List all course names.
3. Get details of students enrolled in course 'DBMS'.
4. Find names of students who are enrolled in at least one course.
5. List students who are NOT enrolled in any course.
6. Find the names of students enrolled in all courses.
7. Retrieve the names of students with grade 'A'.
8. Get student names enrolled in more than 3 credits courses.
9. Display pairs of student names who belong to the same department.
10. List students who are enrolled in DBMS but not in OOP.
2) SQL
Given database:
Employee(EID, EName, DeptID, Salary, HireDate)
Department(DeptID, DeptName, Location)
Project(PID, PName, DeptID, Budget)
WorksOn(EID, PID, Hours)
Write SQL Queries
1. Retrieve all employee names and their department names.
2. List employees with salary > 80,000.
3. Display employees hired after 2020-01-01.
4. Find total salary expense of each department.
5. Show the highest salary in the company.
6. Retrieve employees working in ‘IT’ department.
7. Display all departments with no employees.
8. Find employees working on more than 2 projects.
9. List the projects with a budget greater than 5,00,000.
10. Retrieve the average salary of employees in each department.
3) ACID Transaction & Concurrency (THEORY)
a) Define ACID Properties in transactions. Explain each with an example. (6 Marks)
b) What is Concurrency Control? Why is it needed in DBMS? (3 Marks)
c) Differentiate between Deadlock and Starvation in transaction management. (3 Marks)
d) Explain Two-Phase Locking Protocol (2PL). (3 Marks)
4) Basics of Excel & Power BI
a) What is the importance of Excel in data analysis? (2 Marks)
b) Define Power BI and its uses. (3 Marks)
Excel Commands & Formulas (20 Marks)
Write the purpose of the following Excel commands:
1. VLOOKUP
2. HLOOKUP
3. CONCATENATE
4. TRIM
5. LEN
6. LEFT
7. RIGHT
8. MID
9. PROPER
10. UPPER
11. LOWER
12. IF
13. AND
14. OR
15. NOT
16. ROUND
17. COUNT
18. COUNTA
19. NOW
20. TODAY
THE END