You are on page 1of 5

U.S.N.

B. M. S. College of Engineering, Bengaluru - 560019


Autonomous Institute Affiliated to VTU
July / August 2019 Supplementary Examinations
Programme: B.E. Semester : IV
Branch : Computer Science And Engineering Duration: 3 hrs.
Course Code: 15CS4DCDBM Max Marks: 100
Course: Database Management Systems Date: 01.08.2019

Instructions: 1. Answer any FIVE full questions, choosing one full question from each unit.
2. Missing data, if any, may suitably assumed.

UNIT - I
1. a) Discuss the main characteristics of the database approach. How does it 07
differ from the traditional approach of programming with files?
Important Note: Completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.

b) Consider BOOK DEALER DATABASE .The following tables are 07


maintained by a book dealer:
AUTHOR(author-id, name, city, country)
PUBLISHER(publisher-id, name, city, country)
CATALOG(book-id, title, author-id, publisher-id, category-id, year, price)
CATEGORY(category-id, description)
ORDER-DETAILS(order-no, book-id, quantity)
Revealing of identification, appeal to evaluator will be treated as malpractice.

Write the SQL Query for the following:


i. Give the details of the authors who have 2 or more books in the
catalog and the price of the books in the catalog and the year of
publication is after 2017.
ii. Find the author of the book which has maximum sales.
iii. Demonstrate how you increase the price of books published by a
specific publisher by 10%.
c) Consider the following tables 06
 cool_drink(name, manf)
 sells(cooldrink_name, price)
Write Assertion to check, The minimum price charged for products made
by Coca-Cola Company should be Rs.30/-

OR
2. a) Explain three schema architecture with neat diagram and discuss the 06
importance of logical data independence and physical data independence.
b) Consider the following relations for an Order Processing database 07
application in a company.
CUSTOMER (cust_no, cname, city)
ORDER (order_no, odate, cust_no, ord-Amt)
ITEM (item_no, unit-price)
ORDER-ITEM (order_no, item_no, qty)
WAREHOUSE (warehouse_no, city)
SHIPMENT (order_no, warehouse_no, ship-date).
Write SQL for the following quires.
i. Produce a listing cname, Number of orders, Avg_Order_Amt,
where the middle column is the total numbers of orders by the
customer and the last column is the average order amount for that
customer.
ii. List the order_no for orders that were shipped from all warehouses
that the company has in a specific city.
iii. Demonstrate how you delete item_no 10 from the ITEM table and
make that field null in the ORDER_ITEM table.
c) Distinguish between EXISTS and NOTEXISTS clauses used in SQL with 07
an example.

UNIT - II
3. a) Show with an example violation of the constraint in each of the three 06
types of update operations and how it can be overcome.
b) Explain relational algebra DIVISION operation. Find the quotient for the 06
following: A/B1, A/B2 and A/B3; where A, B1, B2 and B3 are

c) Design the ER diagram for the following requirements (capture all the 08
relationship constraints in the diagram):
Consider order database in which employees take orders for product from
customers. The requirements are:
a) Each Employee is identified by EMP_ID, EMP_Name & Address
(Street num, area name, city).
b) Each Customer is identified by CUST_ID, CUST_Name, Mobile
Number(multiple values).
c) Each Product is identified by Product_ID, Product_name, Price
and Quantity.
d) Each Employee can take order from more than one Customer.
e) Each Customer can place request for more than one Product.
f) Each Employee can deliver more than one Product.

OR
4. a) Explain different kinds of joins with example. Consider the following 06
tables T1(P,Q,R) and T2(A,B,C). Find the output of the following
relational algebra expressions (Note: Domains of table T1 and T2 are
compatible)

i. T1⟕(T1.P = T2.A)T2 ii. T1UT2


b) Give the relational schema diagram for the following ER-Diagram. 07
Appropriately label the primary key and corresponding foreign key
references.

c) Consider the following relations for a BOOK CLUB. Write relational 07


algebraic query for the following.
Members (Member_id, Name, Designation, Age)
Books (Bid, Btitle, Bauthor, Bpublisher, Bprice)
Reserves (Member_id, Bid, Date)
Where Bid is book identification, Btitle is book title, Bpublisher is book
publisher, and Bprice is book price,
i. Find the names of members who are professors older than 45
years.
ii. List the titles of books reserved by professor.
iii. Find IDs of members who have not reserved books that cost more
than Rs.800.
iv. Find the names of members who have reserved all books.
v. Find the author and title of books reserved on 23-April-2019.

UNIT - III
5. a) Define Normalization. Explain the informal design guidelines for 10
relational schema.
b) Consider the dependency diagram shown in the following figure 10

i. Find Primary and Candidate key and List of all functional


dependencies present in the above dependency diagram.
ii. Decompose the relation into 2NF. Write dependency diagrams
after decomposing into 2NF with mention of keys and functional
dependencies.
iii. Decompose the relation into 3NF using the functional dependency
diagrams generated in sub question (ii). Write dependency
diagrams after decomposing into 3NF with mention of keys and
functional dependencies

UNIT - IV
6. a) List and Explain the Desirable properties of transaction. 06

b) Discuss Aries Recovery algorithm. 07

c) Explain serializable and conflict serializable schedule. Create precedence 07


graph for the following schedule. Determine whether it is (conflict)
serializable schedule or not.
W1(A), R2(A), W1(B), W3(C), R2(C), R4(B), W2(D), W4(E), R5(D),
W5(E)

UNIT - V
7. a) Differentiate between Third Normal Form and Boyce-Codd Normal Form. 06
Explain with an example.
b) Consider the following two set of functional dependencies. 06
F={A->C, AC->D, E->AD, E->H}
G={A->CD,E->AH}
Check whether the F and G are equivalent.
c) Define View in SQL. Consider the following tables. 08
Employee

Fname Minit Lname Ssn Bdate Address Salary Dno


Department

Dname Dnum Mgr_startdate Mgr_ssn


Project

Pname Pnumber Plocation Dnum

Works_On

Ssn Pnumber Hours

Write the SQL Queries for the following:


i. Create a view Works_On1 which includes Fname,Lname ,Pname,
ii. Create a view Dept_Info which includes Department number,
Number of employees in each department and Sum of the salary of
all employees in each department.
iii. Retrieve the last name and first name of all employees who work
on product ‘XYZ’.
iv. Select Department number and Number of employees from view
Dept_Info whose sum of salary is greater than 1, 00000.

*****

You might also like