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

DBMS Q Bank

The document contains questions about database concepts like the entity-relationship model, relational model, relational algebra, and SQL. It asks the student to define terms, draw ER diagrams, write relational algebra expressions and SQL queries, and explain concepts such as the three schema architecture, data independence, and aggregate functions in SQL. The questions cover a wide range of topics relating to database management systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

DBMS Q Bank

The document contains questions about database concepts like the entity-relationship model, relational model, relational algebra, and SQL. It asks the student to define terms, draw ER diagrams, write relational algebra expressions and SQL queries, and explain concepts such as the three schema architecture, data independence, and aggregate functions in SQL. The questions cover a wide range of topics relating to database management systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

UNIT-1

CO BL
SNO QUESTION
Draw an ER diagram for UNIVERSITY Database. Assume suitable attributes for each
a CO-1 BL-3
entity. Also specify primary key for each entity and structural constraints.
1
b Define Attribute in E-R model and explain all the structural constraints. CO-1 BL-2

a Write various applications of database system. CO-1 BL-2


2
Explain the component modules of a DBMS and their interactions with the
b CO-1 BL-2
architecture.
a Discuss extended ER features with an example. CO-1 BL-2
3
b Draw an ER diagram corresponding to customers and loans. CO-1 BL-2

a Define a schema. Explain the three schema architecture in detail. CO-1 BL-2

Draw the E-R diagram of typical banking system. Each customer does have unique
4 Account number, address, telephone number, type of account. A customer can
b have any one account in the bank. Bank is identified by Branch ID, Branch name, CO-1 BL-3
Address. Bank offers various types of loans. Customer can avail any number of
loans. All the transactions are identified by Trans ID, Time of trans.
a Justify “data abstraction is an implicit feature of DBMS”. CO-1 BL-2
5 What is the key role of an attribute? Identify the different types of attributes that
b CO-1 BL-2
occur in ER model.
List the various users of a Database Management System. What are the major
a CO-1 BL-2
functions of a Database Administrator (DBA).
6
Define the following terms with example:
b CO-1 BL-2
i. Weak Entity ii. Cardinality Ratio iii. Strong entity iv. Attributes
a Distinguish between database systems and file systems. CO-1 BL-3
7 Give reason, why ER model is used to create an initial design. List all and explain
b CO-1 BL-2
any three steps involved in Database design process.
Draw an ER diagram for University Database with at least three entity types and
a CO-1 BL-2
8 also specify relevant constraints.
b Discuss the concept of Aggregation with an example CO-1 BL-2
Explain three schema architecture, the Logical data independence and Physical
a CO-1 BL-2
9 data independence.
b Define entity, attribute and explain notations of ER diagram with an example. CO-1 BL-2
a Bring out the additional features of E-R model. CO-1 BL-2
10 Define relationship and relationship set. Explain key constraint and participation
b CO-1 BL-2
constraint with an example.
Exemplify a database management system application. List and explain the various
11 a CO-1 BL-2
disadvantages of using file system over database systems.
Construct an E-R diagram for an online flower store. The customer should be able
b to order flowers of his/her choice to a destination on a particular date. Make all CO-1 BL-2
the necessary assumptions.
a Define Database Administrator (DBA). Discuss the functions of DBA. CO-1 BL-2
Construct an E-R diagram for a COMPANY database with the following
requirements: The company is organized into DEPARTMENTs. Each department
has a unique name, unique number and an employee who manages the
department. We keep track of the start date of the department manager. The
12
department may have several locations. We store each EMPLOYEE’s social security
b CO-1 BL-3
number, address, salary, sex, and birth date. Each employee works for one
department. We also keep track of the direct supervisor of each employee. Each
employee may have a number of DEPENDENTs. For each dependent, we keep
track of their name, sex, birth date, and relationship to employee. Give each step
in the construction of E-R diagram.
Define the following terms with an example: entity, attribute, relationship set, key,
a CO-1 BL-2
aggregation.
13
List the various users of a Database Management System. What are the major
b CO-1 BL-2
functions of a Database Administrator (DBA).
Explain three schema architecture, the Logical data independence and Physical
a CO-1 BL-2
14 data independence.
b Define entity, attribute and explain notations of ER diagram with an example. CO-1 BL-2
A university database contains information about professors (identified by social
security number) and courses (identified by course-id). Professors teach courser;
each of the following situations concerns the Teaches relationship set. For each
situation, draw an ER diagram that describes it (assuming no further constraints
a hold). Professors can teach the same course in several semesters, and each CO-1 BL-3
15 offerings must be recorded. Professors can teach the same course in several
semesters, and only the most recent such offering needs to be recorded. (Assume
this condition applies in all subsequent questions). Every professor must teach
some course. Every professor teaches exactly one course (no more no less).
List and explain the various disadvantages of using file system over database
b CO-1 BL-2
systems
a Define Relational Algebra? List and explain different Join Operations. CO-1 BL-2
16
With an example explain the following relational algebra operators:
b CO-1 BL-2
i. Selection ii. Projection

Consider the following schema.


Sailors (sid, sname, Rating, age)
Boats (Bid, Bname, Color)
Reserves (sid, Bid, day)
17 Write queries in relational algebra. CO-1 BL-3
i. Write the names of sailor who have reserved boat number 123
ii. Display names of sailor who have reserved green and red boad
iii. Display names of sailor and boat reserved on Thursday
a iv. Find boat id who have reerved all “Interlake” boats
Explain mapping of ER diagram to relational model to design logical database
CO-1 BL-2
b schema with examples.
Define Relational Algebra? List and explain different Join Operations. CO-1 BL-2
a
18
Compare the different joins in relational algebra. CO-1 BL-2
b
UNIT-2
SNO QUESTION CO BL
a Explain any three aggregate operations in SQL. CO-2 BL-3
1 Compare the execution of nested queries with correlated nested queries with
b CO-2 BL-3
example.
WORKS (Pname, Cname, Salary)
LIVES(Pname, Street, City)
LOCATED_IN(Cname, City)
Where Pname=Person name, Cname=Company name and Mgrname=Manager
name. Write the Relational Algebra Expressions for the following:
2 CO-2 BL-3
i. Find the people who work for the company ‘Infosys’ with a salary more than
Rs.50000/-
ii. List the names of the people along with the street and city addresses
iii. Find the names of the persons who live and work in the same city
iv. Display the average salary and number of the employees company wise
Explain the following with examples:
a CO-2 BL-3
i. DDL ii. DML
Write appropriate SQL DDL statements to create the following relations of a
database that keeps track of business trips of salespersons in a sales office:
3 SALESPERSON(Ssn, Name, Start_year, Dept_no)
b TRIP(Ssn, From_city, To_city, Departure_date, Return_date, Trip_id) CO-2 BL-3
EXPENSE(Trip_id, AccountNo, Amount)
Account(AccountNo, Name, Bank, Branch)
Specify the keys and referential actions.
a Define view? Illustrate view with an example. CO-2 BL-3
4
b Explain various Join operations in SQL with an example. CO-2 BL-3
Discuss with an example, the standard operations on sets are available in relational
a CO-2 BL-3
algebra.
Consider the following relational schema:
Account: Account_number, account_type, balance
Customer: Customer_number, Name, Adhaar_number, address.
Deposits: Account_number, Customer_number,
5
Write the optimized SQL queries for the following:
b CO-2 BL-3
i. Write SQL insertion query to insert few tuples to all the relations
ii. Add 5% interest to the customer who have less than 10,000 balances and 6%
interest to remaining customers
iii. Find the customers whose balance is more than the average balance of the
entire customers
Explain mapping of ER diagram to relational model to design logical database
6 a CO-2 BL-3
schema with examples.
Explain the following integrity constraints and specify the same in SQL:
b CO-2 BL-3
i. Key Constraints ii. Foreign key constraints
a Write short notes on triggers in SQL. CO-2 BL-3
Consider the following schema:
Suppliers(sid: integer, sname: string, address: string)
Parts(pid: integer, pname: string, color: string)
Catalog(sid: integer, pid: integer, cost: real)
7 The key fields are underlined, and the domain of each field is listed after the field
b name. Therefore sid is the key for Suppliers, pid is the key for Parts, and sid and pid CO-2 BL-3
together form the key for Catalog. The Catalog relation lists the prices charged for
parts by Suppliers. Write the following queries in relational algebra, tuple relational
calculus, domain relational calculus and SQL:
i. Find the names of suppliers who supply some red part.
ii. Find sid’s of suppliers who supply some red or green part.
a Define participation constraint. Explain its types with an example. 5M CO-2 BL-3
Consider the following schema:
Suppliers(sid , sname , address)
Parts(pid , pname , color )
Catalog(sid , pid , cost )
8
b Write the relational algebra queries for the following: CO-2 BL-3
i. Find the name s of suppliers who supply some red part
ii. Find the sid s of suppliers who supply some red or green part
iii. Find the sid s of suppliers who supply every part
iv. Find the pid s of parts supplied by at least two different suppliers
What are the aggregate functions? And list the aggregate functions supported by
a CO-2 BL-3
9 SQL
b Explain FROM, HAVING, GROUP BY, WHERE and ORDER BY clauses. With quarries. CO-2 BL-3
a Discuss about DCL commands. CO-2 BL-3
10
b Write about logical database design. CO-2 BL-3
Explain different Integrity constraints can be specified in the relational model with
a CO-2 BL-3
an example
11
With an example explain the following relational algebra operators:
b CO-2 BL-3
i. Selection ii. Projection
Discuss Entity integrity and Referential integrity constraints. Why each is considered
12 a CO-2 BL-3
important.
Consider the following relational schema. An employee can work in more than one
department; the pcLtime field of the Works relation shows the percentage of time
that a
given employee works in a given department.
Emp(eid: integer, ename: string, age: integer, salary: real)
Works(eid: integer, did: integer, pet_time: integer)
Dept(did.· integer, budget: real, managerid: integer)
b Write the following queries in SQL: CO-2 BL-3
i. Print the names and ages of each employee who works in both the Hardware
department and the Software department
ii. Print the name of each employee whose salary exceeds the budget of all of the
departments that he or she works in
iii. Find the managerids of managers who control the largest amounts
iv. Find the enames of managers who manage only departments with budgets
larger than $1 million, but at least one department with budget less than $5 million
Explain how primary keys help us to represent many-to-many, many-to-one, one-
a CO-2 BL-3
tomany, and one-to-one relationship sets in the relational model.

Consider the following two tables exists:


CREATE TABLE Movies (
Code INTEGER PRIMARY KEY NOT NULL,
Title TEXT NOT NULL,
Rating TEXT
);
CREATE TABLE MovieTheatres (
Code INTEGER PRIMARY KEY NOT NULL,
13 Name TEXT NOT NULL,
b Movie INTEGER CO-2 BL-3
CONSTRAINT fk_Movies_Code REFERENCES Movies(Code)
);
Write SQL Queries for:
i) Select all data from all movies and, if that movie is being shown in a theatre, show
the data from the theatre.
ii) Show the titles of movies not currently being shown in any theatres using joins
and subquery.
iii) Select all data from all movie theaters and, additionally, the data from the movie
that is being shown in the theater (if one is being shown)
UNIT-3
SNO QUESTION CO BL
Illustrate redundancy and the problems that it can cause. Give examples of insert,
a delete, and update anomalies. Explain how the problems caused by redundancy C0-3 BL-3
1
can be resolved.
b Explain the necessity of Third Normal Form with an example. C0-3 BL-2
a Define functional dependency. Explain Boyce-Codd Normal Form. C0-3 BL-2
2
b What is the significance of decomposition? Discuss the two properties of C0-3 BL-2
decomposition.
Discuss the following with respect to Functional Dependency:
3 C0-3 BL-2
i. Attribute closure ii. Armstrong’s Axioms

Consider the attribute set R = ABCDEGH and the FD set F = {AB → C, AC → B, AD →


E, B → D,
BC → A, E → G}.
For each of the following attribute sets, do the following:
a. Compute the set of dependencies that hold over the set and write down a
a minimal cover. C0-3 BL-3
4
b. Name the strongest normal form that is not violated by the relation containing
these attributes.
c. Decompose it into a collection of BCNF relations if it is not in BCNF
i. (a) DCEGH (b) ACEH
ii. Is the following decompositions of R = ABCDEG, with the same set of
dependencies F, is (a) dependency-preserving? (b) lossless-join?
b Discuss about schema refinement in database design. C0-3 BL-2

a What is the need for normalization? Discuss all normal forms with a diagram and C0-3 BL-3
example.

Consider the following relation:


R (Doctor#, Patient#, Date, Diagnosis, Treat_code, Charge)In the above relation, a
5 tuple describes a visit of a patient to a doctor along with a treatment code and
b daily charge. Assume that diagnosis is determined (uniquely) for each patient by a C0-3 BL-3
doctor. Assume that each treatment code has a fixed charge (regardless of
patient). Is this relation in 2NF? Justify your answer and decompose if necessary.
Then argue whether further normalization to 3NF is necessary, and if so, perform
it.
6 a Illustrate lossless join decomposition. C0-3 BL-2
i. Find the minimal cover of the following set of functional dependencies.
F=[A->D BC->AD C->B E->A E->D]
b ii. What is the key of R .Consider the universal relation? C0-3 BL-3
R(A,B,C,D,E,F,G,H,I,J) and the set of functional dependencies.
F=[{A,B}-> C,{A}-> {D,E}, {B} -> {F},{F}->{G,H} {D}-> {I ,J}]Decompose R into 2NF and
then 3NF RELATIONS?

Consider the following collection of relations and dependencies. Assume that each
relation is obtained through decomposition from a relation with attributes
ABCDEFGHI and that all the known dependencies over relation ABCDEFGHI are
listed for each question. (The questions are independent of each other, obviously,
since the given dependencies over ABCDEFGHI are different.) For each
(sub)relation: (a) State the strongest normal form that the relation is in. (b) If it is
a C0-3 BL-3
not in BCNF, decompose it into a
collection of BCNF relations:
7 i. R1(A,C,B,D,E), A → B, C → D
ii. R2(A,B,F), AC → E, B → F
iii. R3(A,D), D → G, G → H
iv. R4(D,C,H,G), A → I, I → A
v. R5(A,I,C,E)
What is the key of R .Consider the universal relation?
b R(A,B,C,D,E,F,G,H,I,J) and the set of functional dependencies. C0-3 BL-3
F=[{A,B}-> C,{A}-> {D,E}, {B} -> {F},{F}->{G,H} {D}-> {I ,J}]Decompose R into 2NF and
then 3NF RELATIONS?
a Illustrate redundancy and problem that it can cause with example. C0-3 BL-3
8
b Define Normal Form. Which normal form satisfies multivalued dependency? C0-3 BL-3
Explain it with an example.

a Give a set of FDs for the relation schema R(A,B,C,D) with primary key AB under C0-3 BL-3
Which R is in 2NF but not in 3NF?
9 i. Describe the properties of relational decomposition
b ii. Discuss the rules to satisfy the following normal forms: C0-3 BL-3
I. 5NF
a Describe the problems associated with decomposition. C0-3 BL-3
10
b Explain multi-valued dependency and Fourth Normal Form C0-3 BL-3
UNIT-4
SNO QUESTION CO BL
a List and Explain the important properties of transactions that DBMS must ensure to CO-4 BL-3
1 maintain data concurrency and system failures.
b Explain Strict Two-Phase Locking mechanism. CO-4 BL-2
Create precedence graph for the following schedule. Determine whether it is (conflict)
a serializable schedule or not. W1(A), R2(A), W1(B), W3(C), R2(C), R4(B), W2(D), W4(E), CO-4 BL-3
2 R5(D), W5(E).
Explain deadlock with an example. Discuss how deadlock prevention and detection
b CO-4 BL-2
can be achieved.
a Justify “Conflict serializability is equal to view serializability, but vise versa”. CO-4 BL-3
3
b Define Transaction. Draw the transaction states. CO-4 BL-2
a Explain the difference between deferred and immediate log files. CO-4 BL-2
4
b Explain ACID properties of transaction. CO-4 BL-2
a Describe Properties of a Transaction with state Transition diagram. CO-4 BL-2
5 Discuss the anomalies of interleaved execution of transaction in detail with an
b CO-4 BL-2
example.
a What is decomposition? State the properties of decomposition. CO-4 BL-2
6 Discuss Time-stamp ordering protocol for concurrency control. How does strict time
b CO-4 BL-3
stamp ordering differ from basic time stamp ordering.
a Describe Properties of a Transaction with state Transition diagram. CO-4 BL-2
7 Discuss the anomalies of interleaved execution of transaction in detail with an
b CO-4 BL-3
example.
a Write about Shadow paging. CO-4 BL-2

Consider the following two transactions:


T 31 : read(A);
read(B);
if A = 0 then B := B + 1;
write(B).
8
b T 32 : read(B); CO-4 BL-3
read(A);
if B = 0 then A := A + 1;
write(A).
Add lock and unlock instructions to transactions T 31 and T 32 , so that they observe
the two-phase locking protocol. Can the execution of these transactions
result in a deadlock? Justify
a What is two phase protocol? How does it guarantee serializability? CO-4 BL-3
9
b How the schedules can be characterized based on serializability? Give an example. CO-4 BL-3
Discuss the anomalies of interleaved execution of transaction in detail with an
a CO-4 BL-3
10 example.
b Draw & explain the different states of transaction. CO-4 BL-3
Delineate the anomalies that may arise due to the interleaved execution of
a CO-4 BL-3
11 transactions with a suitable example.
b Explain transaction schedules based on recoverability. CO-4 BL-3
a Explain the state transition diagram of a transaction CO-4 BL-3

Consider a database with objects X and Y and assume that there are two transactions
T1 and T2. Transaction T1 reads objects X and Y and then writes object X. Transaction
T2 reads objects X and Y and then writes objects X and Y.
i. Give an example schedule with actions of transactions T1 and T 2 on objects X and Y
12
b that results in a write-read conflict CO-4 BL-3
ii. Give an example schedule with actions of transactions T1 and T 2 on objects X and Y
that results in a read-write conflict
iii. Give an example schedule with actions of transactions T1 and T2 on objects X and Y
that results in a write-write conflict
iv. For each of the three schedules, show that Strict 2PL disallows the schedule.
a Define deadlock? Discuss deadlock prevention. CO-4 BL-3
13
b Explain strict Two-Phase locking protocol for concurrency control. CO-4 BL-3
a Illustrate schedule. Explain conflict serializable schedule with an example. CO-4 BL-3
14 i. Describe ACID properties of a transaction
b CO-4 BL-3
ii. Write a short note on recovery system
UNIT-5
SNO QUESTION CO BL
a Explain the working of hashing in file organization. C0-5 BL-3
1
b Explain ARIES algorithm. C0-5 BL-3
a Write short notes on indexed sequential access method (ISAM). C0-5 BL-2
2
b State how indexing in done in database management systems. C0-5 BL-3
a State the advantages and disadvantages of storing data using the RAID method. C0-5 BL-3
3
b Write short notes on B+Trees. C0-5 BL-2
a Compare and contrast between ISAM and B+ trees. C0-5 BL-3
4
b Explain dynamic tree structure with an example. C0-5 BL-3
Which of the five organizations would you choose for a file where the most frequent
operations are as follows?
a i. Search for records based on a range of field values C0-5 BL-3
5 ii. Perform inserts and scans, where the order of records does not matter
iii. Search for a record based on a particular field value

b What is clustered index organization? Illustrate with examples, the importance of C0-5 BL-2
clustered index on a range query, search key and aggregate operations.
a What is the purpose of Database Recovery? C0-5 BL-2
6
b Explain about NoSQL C0-5 BL-3

You might also like