0% found this document useful (0 votes)
280 views

DBMS Questions

This document contains 65 questions related to database management systems. The questions cover a wide range of topics including DBMS concepts, data modeling using entity-relationship diagrams, database normalization, relational algebra, relational calculus, and SQL queries.

Uploaded by

Mazharulislam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
280 views

DBMS Questions

This document contains 65 questions related to database management systems. The questions cover a wide range of topics including DBMS concepts, data modeling using entity-relationship diagrams, database normalization, relational algebra, relational calculus, and SQL queries.

Uploaded by

Mazharulislam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 10

1

Database Management System I

Question Bank: 2010

1) What is DBMS?
2) What are the advantages of using DBMS over file processing systems?
3) Describe different levels of Data Abstraction in database system.
4) What is the difference between database and database management system?
5) What are the different types of database users?
6) What are the functions of DBA?
7) What are the advantages and disadvantages of DBMS over File Management
System?
8) What do you mean by Instances and Schemas?
9) Why would you choose a database system instead of simply storing data in
operating system files?
10) Explain the difference between external, internal and conceptual schemas.
11) Distinguish between logical and physical data independence.
12) What is physical data independence and logical data independence?
13) Explain the three schema architecture.
14) Explain generalization, specialization and aggregation in Entity Relation
Diagram.
15) Write down the functions of a DBA.
16) Describe the actors in DBMS.
17) Define the following: Derived attribute, Domain, 1 to Many relationship,
Projection, Union compatibility.
18) What is the difference between metadata and dictionary?
19) Why is the data dictionary required in RDBMS?
20) What are the differences among hierarchical model, network model and
relational model of database?
21) Compare and contrast of the following:
a. Specialization & Generalization
b. Multivalued attribute and Composite attribute
c. Super key and Candidate key.
22) What is E-R diagram? Define ER model.
23) Discuss about relationship cardinality.
2

24) What is an entity?


25) What do you mean by multi-valued attribute?
26) What is Weak Entity set? Explain with an example.
27) Define: Super key, candidate key, primary key, foreign key and alternate key.
28) Define entity integrity and referential integrity. Explain the difference
between them through example.
29) It is strictly necessary to declare Primary key and Foreign key during
database creation. If you do not do that then what problem can arise?
30) Draw the E-R diagram of WBSTC (West Bengal State Transport
Corporation) with your own assumptions.
31) Consider a University database for scheduling of classrooms for final
examination. Their database could be modeled as the single entity EXAM,
with attributes course_name, section_no, room_no and time. Alternatively,
one or more additional entity sets could be defined, along with relationship
sets to replace some of the attributes of the EXAM entity set, as:
a. COURSE with attributes name, dept and c_no.
b. SECTION with attributes s_no and enrolment and dependent as a
weak entity set on COURSE.
c. ROOM with attributes r_no, capacity, building.
For these two design alternatives draw an E-R diagram illustrating the use of all
three additional entity sets. Clearly mention the primary keys and different
relationships. Assumptions should be mentioned clearly.
32) From the following information identify the entities, relationships and draw
the ER diagram: A store has different counters managed by different
employees. A counter has item but no two counters have common items.
Customers buy from different counters but bills are prepared at the bill
counter only. Once in a month the performance of the persons managing
different counters are evaluated in terms of sale. Items are also reviewed and
slow moving items are identified.
33) Consider a university database for the scheduling of classrooms for final
exams. This database could be modeled as the single entity set exam, with
attributes course_name, section_number, room_number and time.
Alternatively, one or more additional entity sets could be defined, along with
relationship sets to replace some of the attributes of the exam entity set, as
course with attributes name, department and c_number section with
attributes s_number and enrollment and dependent as a week entity set on
course. Room with attributes r_number, capacity and building.
Draw an E-R diagram for the above problem. Reduce the E-R diagram into
relational schema by defining all the constraints and assumptions.
3

34) Explain with example the concept of reducing to relational schema in case
specialization and generalization.
35) What is system catalog or catalog relation? How is it better known as?
36) What is DML Compiler? Explain its purpose.
37) What are the fundamental operations in relational Algebra? Explain each
operation with example.
38) What are the differences between tuple relational calculus and domain
relational calculus?
39) What is BCNF (Boyce-Codd Normal Form)? Give examples.
40) What is Lossless join property? Give an example.
41) Why is normalization required?
42) Define: Functional dependency (FD), Closure, canonical Cover.
43) If R = (A, B, C, D, E, F, G) in a relation and F.D ={A→B, BC→DE, AEF→G}
Compute the closure AC+ under this set of FDS. Is the FD ACF→DG implied by
this set?
44) If F = {A→BC, CD→E, E→C, D→AEH, ABH→BD, DH→BC} Find the
canonical cover.
45) For the relation R= (L, M, N, O, P) and F. D = {M→O, NO→P, P→L,
L→MN}, R is decomposed into R1= (L, M, N, P) and R2 = (M, O). Is the
above decomposition a lossless join decomposition?
46) What do you mean by normalization? Define: 2NF, 3NF and BCNF
47) If R = (A, B, C, D, E) and F.D = {A→BC, C→B, AD→E}, find the normal
form of the relation R. Write the different steps to convert it into BCNF.
48) What is the highest NF of each of the following relations?
a. R1 (A, B, C) with FDs are A→B, A→C, C→B
b. R2 (A, B, C, D) with FDs are A→BC, CD→B.
49) Consider the following table with their functional dependencies:
Employee (Emp_Id, Emp_Name, Address, Design, Dept_Id, Dept_Name,
Course, Duration)
Emp_Id→ Emp_Name, Address, Design, Dept_Id, Course
Dept_Id→ Dept_Name
Course→ Duration
Normalize the table up to BCNF.
4

50) Consider the following relational schema:


Emp_Project ( SSN, Ename, City, Status, PNO, Pname, Hour). Write all the
functional dependency exists in this relation. Consider the relation is in 1 NF.
Normalize it upto 3 NF.
51) For the relation R = ( L, M, N, O, P) and F.D. = { M->O, NO->P, P->L, L-
>MN}, R is decomposed into R1 = (L, M, N, P) and R2 = (M, O).
Is the above decomposition lossless & dependency preserving?
52) Define 1 NF, 2 NF, 3 NF, BCNF.
53) Consider the following table with their functional dependencies:
SUPPLIER (S#, P#, Status, City, Quantity)
Quantity depends on S#, P#
City depends on S#
Status depends on S# and city.
Starting from 1 NF normalize the relation as far as possible. What is the highest
normal form you have achieved?
54) Compare and contrast between 3NF and BCNF.
55) Define ‘Functional dependency’ and give examples.
56) Discuss insertion, deletion and modification anomalies that arises in different
stages of normalization. Illustrate with example.
57) Prove that any relation schema with two attributes is in BCNF.
58) Consider the following two sets of functional dependencies:
F= {A→C, AC→D, E→AD, E→H}
G= {A→CD, E→AH}
Check whether they are equivalent.
59) Why is a relation that is 3NF generally considered good?
60) R= (A, B, C, D, E) F= {A→BC, CD→E, B→D, E→A}, Show that it is
lossless decomposition.
61) Find out closure of attribute set (AG) i.e., (AG)+ in the relational schema R
and set of functional dependencies F as given below:
R= (A, B, C, G, H, I)
F= {A→B, A→C, CG→H, CG→I, B→H}
Is (AG) a super key of R?
5

62) Consider the relation given below:


SCHEDULE (StdId, ClassNo, StdName, StdMajor, ClassTime, ClassRoom,
Instructor)
Following are functional dependencies of SCHEDULE:
StdId→ StdName StdId→ StdMajor
ClassNo→ ClassTime ClassNo→ ClassRoom
ClassNo→ Instructor
What is the highest normal form of this relation?
63) Answer as directed for the following:
Hotel (Hno, Name, Address) Room (Rno, Rtype, Hno, Price)
Booking (Hno, Gno, Rno, Dt_from, Dt_to), Guest (Gno, GName, GAddress)
a. Find the names of all guests who are staying in hotels either in Kolkata or
Chennai. [Relational Calculus]
b. Find the total number of guests in Hotel Taj. [Tuple Relational Calculus]
c. List the number of rooms in each hotel. [Domain Relational Calculus]
d. Find the room with the maximum price. [SQL]
e. Find the hotel with 2nd maximum no. of rooms. [SQL]
64) Establish the statement, “SQL is a relationally complete language”.
65) Consider the following schema of a relational database:
Sailors (sid, sname, rating, age)
Reserves (sid, bid, day)
Boats (bid, bname, colour)
For each of the following queries write an expression for Relational Algebra OR
Relational Calculus.
a. Find the names of sailors who have reserved boat 103.
b. Find the names of sailors who have reserved a red boat.
c. Find the colour of boats reserved by Biswarup.
d. Find the names of sailors who have reserved at least one boat.
e. Find the names of sailors who have reserved a red boat or a green boat.
f. Find the names of sailors who have reserved a red boat and a green boat.
g. Find the names of sailors with age over 20 who have not reserved a red
boat.
h. Find the names of sailors who have reserved all boats.
6

66) Consider the following relational schema:


EMP (EmpNo, EmpName, City, Sal, DeptNo)
DEPT (DeptNo, DeptName)
Write down the following queries in SQL:
a. Find the names and cities of all employees working for the “Research”
department
b. Display the number of employees in each department
c. Display the number of employees in department number 20
d. Find the names of employees who have the second highest salary
e. Find the names of employees whose salary is greater then anyone’s salary
of department 10.
67) Consider the following relational database:
Employee (employee name, street, City)
Works (employee name, company name, salary)
Company (Company name, city)
Manager (employee name, manager name)
For each of the following queries, give an expression in relation algebra and
SQL.
a. Find the name of all employees who work for SBI
b. Find name and cities of all employees
c. Find name, street, city of all employees who work for SBI and earn more
than 10000.
68) Consider the following relational schema:
STUDENT (Id, Name)
ENROLEDIN (Id, Code)
SUBJECT (Code, Lecturer)
Write down the following query expressions:
a. Display the names of students enrolled in the subjects having codes cp
1500 or cp 3010. (Relational Algebra)
b. Display the names of all the students enrolled in the subjects having codes
cp 1500. (Tuple Relational Calculus)
c. Display the names of students who are taking a subject not taught by
Roger. (Relational Algebra)
7

69) Consider the following relational schema of Library.


Book (book_id, Title)
Book-author (book_id, authorname)
Book-copies (book_id, branch_id, no_of_copy)
Library-branch(branch_id, branch_name)
Book loan(book_id, branch_id, cardno)
Borrower(name, city, cardno)
Write the query expressions for each of the following queries in specified
language.
a. List the name of books borrowed by the student who belongs to
“Kolkata” (Tuple Relational Calculus)
b. Retrieve the name of student / borrowed by the student who does not
borrow any book. (Domain Relational Calculus)
c. Retrieve the name of library branch which has maximum number of
books. (Relational Algebra)
d. Retrieve the name of borrower who has borrowed at least 3 books and
not more than 10 books. (Relational Algebra)
70) Consider the following relational schema
SHOP (shop_no, shop_name, owner_name)
CUSTOMER (cust_no, cust_name, cust_addr)
SALE (cust_no, shop_no, item, Price)
Write the following queries in SQL:
a. List the name of the customers who purchase all items from one shop.
b. List the name of the customers who purchase items of maximum total
value.
71) Consider the following relational schema:
Employee (empno, empname, deptno, city)
Department (deptno, deptname, location)
Dependent (empno, dependent_name, relationship, dob)
Salary (empno, basic, da, deduction, netpay)
Write the following query expression in specified language.
a. Get the name and city of all employees working for the mechanical
department (Relational Algebra).
b. Get the name and department name of all employees whose basic is
greater then 10000 (Tuple relational calculus).
8

c. Get the name of employees who have no dependent (Domain relational


calculus).
72) Consider the following relations containing airline flight information:
Flights(flno, from, to, distance, departs, arrives)
Aircraft (aid, aname, cruisingrange)
Certified (eid, aid)
Employees(eid, ename, salary)
Write the query expressions for each of the following queries in specified
language.
a. Find the names of pilots certified for some Boeing aircraft (Relational
Algebra).
b. Find the eids of employees who make the second highest salary (Tuple
Relational Calculus).
c. Find the names of pilots who can operate planes with a range greater
than 3000 miles but not certified on any Boeing aircraft. (Domain
Relational calculus)
d. Find the aids of employees who are certified for exactly three aircraft
(SQL).
73) Consider the following relational schema and answer the questions that
follow.
EMP (eid, ename, age, salary)
Works (eid, did, pct_time)
Dept (did, budget, managerid)
a. Define a table constraint on EMP that will ensure that every employee
makes at least $10,000.
b. Write SQL statements to delete all information about employees whose
salaries exceed that of the manager of one or more departments that they
work in.
c. Write SQL statements to find the name of employees who make second
highest salary.
74) Write SQL query to perform the following operations on a Relation.
a. Add a constraint to an attribute
b. Remove a constraint from an attribute
c. Remove an attribute
d. Grant DBA authority to user
e. Revoke authorities on a relation from any user
9

f. Find second max sal of a salary attribute in a relation


g. Insert a Date
h. Insert system date
i. Finding grouped average and filtering some groups out of all groups
j. Deleting duplicate tuples in a relation.
75) What is query processing? What are the different phases of a query
processing? Explain them briefly.
76) Write a PL / SQL program to calculate factorial of a given (suitable) positive
integer.
77) What is cursor in the context of PL / SQL?
78) Differentiate Explicit cursor and Implicit cursor.
79) Write a PL/SQL program to find the sum of W natural numbers
80) What is a view? View does not take any memory space. Justify.
81) How do you create an Insertable and Updateable view?
82) What are the typical phases of query decomposition?
83) What is the difference between conjunctive and disjunctive normal forms?
84) What is meant by query optimization? Explain briefly.
85) Explain the Query optimization technique with relevant examples.
86) What is the difference between primary and secondary storage?
87) What are the differences among primary, Secondary and clustering indexes?
88) Why can we have at most one primary or clustering index on a file, but
several secondary indexes?
89) Illustrate with an example the process of inserting nodes into a B-Tree of
order 3.
90) How does a B-tree differ from a B+-tree? Why is a B+ tree usually preferred
as an access structure to a data file?
91) How does multilevel indexing improve the efficiency of searching an index
file?
92) What is the difference between B tree and B+ tree?
93) What is dense indexing and sparse indexing?
94) Create B+ tree for the following key:
Order = 3 Key: 8, 5, 1, 7, 3, 12, 9, 6.
95) Why is a B+ tree usually preferred as an access structure to a data file?
96) What is a schedule?
10

100) What is the difference between conflict equivalence and view equivalence?
101) Describe the growing phase and shrinking phase with example of the two
phase locking protocol.
102) Describe the wait-die and wound-wait protocols for deadlock prevention
103) Write a short note on any three of the following:
a. Multi-level index
b. Aggregation in ER model
c. Three level data abstraction
d. DBMS architecture
e. Atomicity problem.
f. Specialization and Generalization
g. Aggregation
h. 3-tier architecture
i. Relational Database Management System
j. Advantage of DBMS over tradition file management system
k. Data model
l. Query optimization.
m. Advantages & disadvantages of DBMS.
n. Keys.
o. Database Administrator.
p. Data Model.
q. Weak entity and strong entity.
r. ISAM and VSAM.
s. B+ tree
t. Armstrong’s Axiom for FD.
u. PL/SQL.

You might also like