DATABASE MANAGEMENT SYSTEM QUESTION BANK
Module -1
Q. Bloom’s
Questions COs
No. LL
Define the following:
i. Data
ii. Database
1 iii. DBMS L1 CO1
iv. Snapshot
v. Database Schema
vi. Instance
vii. Data model
2 When not to use database approach? L1 CO1
3 What are the responsibilities of DBA (Database Administrators) and L1 CO1
database designers?
4 List and Explain the advantages of database management system. L2 CO1
5 List and explain the different database languages and interfaces. L2 CO1
6 With the help of diagram explain different phases of database design L2 CO1
7 With neat diagram describe the three schema architecture. Define data L3 CO1
independence. Which data independence is harder to implement why?
8 With the help of diagram illustrate different phases of database design L3 CO1
9 With the help of diagram explain the component modules of database L3 CO1
environment
10 Compare and contrast the database approach with traditional file L4 CO1
processing system.
A bank has many branches, the bank has many customers. A customer
can open many different kinds of accounts with the bank. Any customer
11 of the bank can take a loan from the bank. All branches can give loans. L5&L6 CO1
Bank can also have installed automatic teller machines, from which a
customer can withdraw from his/her bank. Draw the ER diagram for the
bank. Make suitable assumptions, if any.
Module -2
Q. Bloom’s
Questions COs
No. LL
1 Define attribute? List and explain the different types of attributes with L1 CO1
respect to ER model
Page | 1
2 Explain with an example each: L1 CO1
a. Entity types
b. Entity sets
c. key attributes
d. value sets
e. owner entity type f. weak entity type
g. identifying relationship type i. partial key
3 Discuss the entity integrity and referential integrity constraints. Why is L1 CO1
each considered important?
4 List and explain the constraints to be applied for the relationship types L2 CO1
with suitable examples
5 Explain the steps involved in mapping of ER model to relational model L2 CO1
with suitable example.
6 Discuss the various update operations on relations and the types of L3 CO1
integrity constraints that must be checked for each update operation.
7 Illustrate the following operators in Relational Algebra operations. L3 CO2
i. Select ii. Project iii. Join and its types
iv. Division v. Cartesian product vi. Grouping
8 List and Analyze the data types in SQL and different constraints applied L3 CO2
while creating the tables
9 Consider the following schema and write the relational algebra L4 CO2
expressions and SQL statements for the queries given below:
SAILORS(Sid, Sname, rating, age)
BOATS(bid, bname, color)
RESERVES(sid, bid,day)
(i) Find names of sailors who reserved green boat
(ii) Find the colors of boats reserved by “Ramesh”
(iii) Find names of sailors who have reserved a red or a green boat.
(iv) Find the “sids” of sailors with age over 20 who have not
registered a red boat. 22.
10 Consider the schema for Company Database: L5&L6 CO2
EMPLOYEE (SSN, Name, Address, dateofjoin. Sex, Salary, SuperSSN,
DNo)
DEPARTMENT (DNo, DName, MgrSSN, MgrStartDate)
DLOCATION (DNo,DLoc)
PROJECT (PNo, PName, PLocation, DNo)
WORKS_ON (SSN, PNo, Hours)
DEPENDENT(ESSN,Dname,Bdate,Sex,Relationship)
Implement Relational expressions and SQL statements for the following:
i. Retrieve the details of all the employees work for research department.
ii. Find the updated salary of all the employees working on IOT project
iii. Find the details of all the dependents of manager of SPORTS department.
iv. Find the names of all the employees who joined in the year 2012
Find the names of employees who is having female dependents.
Page | 2
Module -3
Q. Bloom’s
Questions COs
No. LL
1 Explain INSERT, DELETE , UPDATE, ALTER statements in SQL L1 CO2
taking suitable examples
2 Illustrate the following with suitable example: L1 CO2
a. Pattern matching in SQL
b. Impedance mismatch
c. Correlated queries
3 Explain the following: L1 CO2
a. EXISTS AND NOT EXISTS
b. ASSERTIONS AND TRIGGERS
4 What is UNION compatibility? Why do the UNION, INTERSECTION L2 CO2
and DIFFERENCE operations require that the relations on whom they are
applied be union compatible?
5 Explain the importance of views along with creation and updating of L2 CO2
views.
6 List and explain the different aggregate functions with suitable examples L2 CO2
7 Illustrate the importance of stored procedures and also describe the L3 CO2
creation and calling of stored procedures with suitable examples.
8 Demonstrate the use of WITH and CASE clause with example L3 CO2
9 Consider the following relational database schema L4 CO2
STUDENT ( Student-id,Sname,major,GPA)
FACULTY (Faculty-id,fname,dept,designation,salary)
COURSE (Course-id,Cname,Faculty-id)
ENROL (Course-id,Student-id,grade)
Write the following queries in SQL:
a. List the names of all students enrolled for the course “IS6T1” and
have received “A” grade.
b. List all the departments having an average salary of above Rs.
10,000.
c. Give a 20% raise to salary of all faculty.
d. List the names of all faculty members beginning with “P” and
ending with letter “A”.
e. Add ‘John’ as an employee with id = 99, and Major =’Maths’
GPA=’B’.
f. Retrieve the faculty who gets the second highest salary.
10 Using cursor mechanism Implement an embedded SQL/SQLJ(either L5&L6 CO2
using named iterator or position iterator) program to update the salary of
all employees of given dept-name.
Page | 3
Module -4
Q. Bloom’s
Questions COs
No. LL
1 What is the need for normalization? Explain the first, second and third L1 CO3
normal forms with examples.
2 Illustrate the informal design guidelines for relation schemas. L1 CO3
3 Explain multivalued dependency. Explain 4NF with an example. L1 CO3
4 What is functional dependency? List and derive the proof for Armstrong L2 CO3
rules.
5 List and give the proof for all the 6 inference rules L2 CO3
6 Define Closure of X under F. ALSO give the algorithm for the same L2 CO3
7 What do you mean by E covered by F? Justify whether the following two L3 CO3
sets of FDs are equivalent.
F: AC, ACD,EAD,EH
G: ACD, EAH
8 Applying the algorithm find the minimal cover the following set of FDs L3 CO3
{A → C, AB → C, C → DI, CD → I, EC → AB, EI → C}
9 Define minimal cover. Write an algorithm for finding minimal cover F for L4 CO3
a set of functional dependencies E. Find the minimal cover for the given
set of FDs
E : {B->A, D->A, AB->D}.
10 Consider the universal relation={A,B,C,D,E,F,G,H,I,J} and the set of FDs L5&L6 CO3
F={{A,B}->{C},{A}->{D,E},{B}->{F},{F}->{G,H},{D}->{I,J}}.
Determine whether each decomposition has the lossless join property
with respect to to F
D1={R1,R2,R3}; R1={A,B,C,D,E}; R2={B,F,G,H}; R3={D,I,J}
Module -5
Q. Bloom’s
Questions COs
No. LL
1 Define transaction. Explain properties of a transaction. L1 CO4
2 Explain transaction support in SQL. L1 CO4
3 Explain the importance of shadow paging method/algorithm L1 CO4
4 What are the anomalies occur due to interleave execution (concurrent L2 CO4
transactions)? Explain them with an example.
5 Write note on: L2 CO4
a) Time stamp based concurrency control
b) Write ahead log protocol
6 Explain Multiple granularity locking with suitable examples L2 CO4
7 With a neat state transition diagram, discuss the different states of L3 CO4
Page | 4
transaction.
8 What is serializibility? How can seriaizability be ensured? Justify your L3 CO4
answer?
9 Briefly discuss the two phase locking (2PL) protocol used in concurrency L4 CO4
control. How does it guarantee serializability? Discuss its advantages.
How does it vary from strict 2PL?
10 When deadlock and starvation problems occurs? Explain how these L5 CO4
problems can be resolved.
TUT3
1. Define transaction. Explain desirable properties of a transaction(ACID)
2. What are the anomalies occur due to interleave execution (concurrent transactions)?
Explain them with an example.
3. Why concurrency control is required
4. What are the various states of transaction ,explain it using state transition diagram
5. Describe the transaction support in SQL
6. Briefly discuss the two phase locking (2PL) protocol used in concurrency control.
How does it guarantee serializability? Discuss its advantages. How does it vary from
strict 2PL?
7. Illustrate Strict Two phase locking protocol
8. When deadlock and starvation problems occur? Explain how these problems can be
resolved..
9. What is functional dependency? List and derive the proof for Armstrong rules.
Explain the following statements with suitable examples:
10. Write an algorithm for finding minimal cover F for a set of functional
dependencies E. Find the minimal cover for the given set of FDs
E : {B->A, D->A, AB->D}.
11. Define minimal cover. Write an algorithm for finding minimal cover F for
a set of functional dependencies E.
1. Find the minimal cover for the given set of FDs
E : {A->BCDE, CD->E}.
12. Illustrate with example multi valued Dependency and fourth normal form
13. Define stored procedure, how to create and call a stored procedure
14. Describe the architecture of JDBC
15. Describe three tier Architectures and illustrate the advantage of it
TUT2
11. Explain the steps of an algorithm for EE-to-Relational mapping.
12. In SQL which command is used for table creation? Explain how the different
constraints are specified in SQL during table creation with suitable example
Page | 5
13. How are Triggers and Assertion defined in SQL? Explain.
14. How is View created and dropped? Explain how the views are implemented and
updated
.
15. Define Stored Procedure. Explain the creating and calling of Stored Procedure with
example
16. Explain the following statements with suitable examples:
i. ALTER ii. DELETE iii. DROP IV. INSERT V. WITH
[Link]
17. With syntax and suitable example illustrate different clauses of Select statement.
18. Consider the following student database
STUDENT(SID, Sname, Major, GPA)
FACULTY(FID,Fname,Dept,Designation,Salary)
COURSES(CID,Cname,FID)
ENROL(CID,SID,GRADE)
Write the following query in SQL
i) Give a15% raise to salary of all faculty
ii) List all the departments having an average salary of above salary
Rs.20,000
iii) List the names of students enrolled for the course’GS-53’and have
received ‘A’grade
iv) List the names of all faculty members beginning with ‘R’ and ending with
‘U’
v) Find the cname and number of students enrolled for each course
vi) Find the name of faculties handing courses in which more than 50 students
are enrolled.
vii) Find the name of students who enrolled for the courses handling by
faculty of ISE dept
19. Considering the schema
SAILORS (sid,sname ,rating, age)
BOATS (bid, bname,color)
RESERVES (sid, bid,day)
Write relational algebra and SQL queries for the following:
i) Retrieve the sailor name with age over 20 years and reserved black boat.
ii) Retrieve the sailor name who have reserved all boats
iii) Retrieve the sailor name who have reserved green boat on Monday
iv) Retrieve the number of boats which are reserved
v) Retrieve the sailor names who is the oldest sailor with rating 10.
vi) Find the details of all the sailors who reserved all the boats reserved by
‘Raj’
vii) Find the names of sailors who not reserved red boats on Monday
20. Consider the schema for Movie Database:
ACTOR(Act_id, Act_Name, Act_Gender)
DIRECTOR(Dir_id, Dir_Name, Dir_Phone)
Page | 6
MOVIES(Mov_id, Mov_Title, Mov_Year, Mov_Lang, Dir_id)
MOVIE_CAST(Act_id, Mov_id, Role)
RATING(Mov_id, Rev_Stars)
Write SQL queries to
i. List the titles of all movies directed by ‘Hitchcock’.
ii. Find the movie names where one or more actors acted in two or more
movies.
iii. List all actors who acted in a movie before 2000 and also in a movie after
2015 (use JOIN operation).
iv. Find the title of movies and number of stars for each movie that has at least
one rating and find the highest number of stars that movie received. Sort the
result by movie title.
v. Update rating of all movies directed by ‘Steven Spielberg’ to 5.
21. Illustrate [Link],UPDATE ,ALTER and DROP statements in SQL
22. Illustrate Aggregate functions in SQL
23. What is the need for normalization Explain 1NF,2NF and 3NF with examples
24. Describe various Informal guidelines for design a database Schema
25. Explain Cursors and its properties in Embedded SQL with suitable example
16. Consider the following relations for a database.
Supplier(Sno, Sname, Status, City)
Product(Pno, Pname, Color, Weight, City)
Shipments(Sno, Pno, Qty)
Specify the following queries in SQL.
i. Retrieve the names of supplier who supply part P2.
ii. Retrieve the names of suppliers who do not supply any part supplied by S2.
iii. Retrieve the part number for all parts supplied by more than one supplier.
iv. For each part supplied, get the part number, maximum qty, minimum qty supplied for the
part.
[Link] the data types supported by SQL?
18. Distinguish between nested queries and Correlated nested queries
19. Consider following scheme for company
Employee (name, ssn,address, gender, salary, dno).
Department (dname, dno, mgr-ssn, mgr-start date)
Department location (dno,dlocation)
Project (pname,pno,Plocation,dno)
Works_on(essn,pno,hours)
Dependent(essn,dependent name,gender,bdate,relationship)
Write queries in relational algebra to ,
i)retrieve name & address of all employees who work for research department.
ii) find names of employees work on all projects controlled by dno 5.
iii)List all projects on which employee Smith is working.
iv) Retrieve names of employees who have no dependents
20 . Consider the following tables
P Q R A B C
Page | 7
10 A 5 10 B 6
15 B 8 10 C 3
25 A 6 10 B 5
Page | 8