Sem DBMS 2022
Sem DBMS 2022
Sem DBMS 2022
1. Let emp {empid, Name, sal, deptid} and dept {did, dname, dloc} are two relations. Answer the
following query in RA.
i) Find the name of employee who earn more than the avg sal of her dept.
ii) Find the name of the employee who earn the highest sal in ‘IT’ dept.
iii) What is the total cost for salary of ‘CSE’ dept.
iv) Which dept has highest employee strength?
v) What is the avg sal of the employees working at ‘3rd floor’.
2. Write an algorithm to find out candidate key(s) from the functional dependency set.
Find the primary key of the table R(A,B,C,D,E,F,G,H), considering
F= { A-->CD, AB-->EG, C-->G, D-->EF, AC-->D, G-->FH }.
3. Define 2NF, 3NF, and BCNF with exmple. State and prove the Amstrong’s axioms V and VI.
4. Describe ACID properties of transaction? What is Cascading Rollback? How it can be avoided?
5. Consider the following Tables: Student {Roll, Name, Address}, Course {Course_id,
Course_name, credit}, Student_Course { Roll , Course_id } and write the following in SQL
statements
i) Write SQL to create the above tables, assuming the appropriate data types
ii) Find the student name who has taken ‘DBMS’ but not ‘Networking’
iii) Find the total credit of the courses taken by ‘Ramiz’
iv) Which course has been taken by the maximum students
v) Print name and address of the students of who has have taken at least 2 courses
7. Define an algorithm for checking loss-less decomposition. Test the following case:
Given a relational schema R = { EMPID, NAME, , PROJ_NAME, PROJ_LOC, HOURS } is
decomposed into the following tables
R1 = {EMPID, NAME }
R2 = { PROJ_NAME, PROJ_LOC} PROJ_ID
R3 = { EMPID, PROJ_ID, HOURS }
The functional dependencies are:
FD = { EMPID → NAME, PROJ_ID → { PROJ_NAME, PROJ_LOC }, { EMPID, PROJ_ID }
→ HOURS }
8. Describe time stamp based locking protocol. What are the methods used for deadlock prevention?
Create an ERD for the following case study showing entity names, primary keys, attributes
for each entity, relationships between the entities and cardinality.
9. What is Precedence Graph? Explain Two-phase Locking protocol. Describe the lifecycle of a
transaction.