CSE2004 Model Question Paper
CSE2004 Model Question Paper
:
Name :
1. Create an E-R diagram for a car dealership. The dealership sells both new and used
cars, and it operates a service facility. Base your design on the following business rules:
A salesperson may sell many cars, but each car is sold by only one salesperson.
A customer may buy many cars, but each car is sold to only one customer.
A salesperson writes a single invoice for each car he or she buys.
A customer gets an invoice for each car he or she buys.
A customer may come in just to have his or her car serviced, that is, one need
not buy a car to be classified as a customer.
When a customer takes one or more cars in for repair or service, one service 10
ticket is written for each car.
The car dealership maintains a service history for each of the cars serviced. The
service records are referenced by the car’s serial number.
A car brought in for service can be worked on by many mechanics, and each
mechanic may work on many cars.
A car that is serviced may or may not need parts. (For example, adjusting a
carburetor or cleaning a fuel injector nozzle does not require the use of parts)
Keyword queries used in Web search are quite different from database queries. List key 5
b)
differences between the two, in terms of the way the queries are specified, and in terms
of what is the result of a query.
3. 10
Map the given ER diagram to a relational schema and state the steps in the mapping
process.
Page 1 of 4
We wish to develop a database to keep track of persons, their children and their cars.
For this purpose, we will use the following relation:
4.
PersonData(pNbr, pName, pAddress, cNbr, cName, cAddress, aLic, aMake)
pNbr, pName, pAddress is the person number, name and address of a person. cNbr,
cName, cAddress is the corresponding information for a child. Each person has exactly
one address. aLic, aMake is the license number and make of a car. A car may be owned
by more than one person
10
a) What are the functional dependencies in this relation? Find the keys of the relation.
10
b) Is this relation in BCNF? Justify. If not, decompose it into relations that are in BCNF.
A company organizes its activities in projects. Products that are used in the projects are
bought from suppliers. This is described in a database with the following schema:
5.
Projects(projNbr, name, city)
Products(prodNbr, name, color)
Suppliers(supplNbr, name, city)
Deliveries(supplNbr,prodNbr,projNbr, number)
a. Write the relational algebraic expression that is equivalent to the above query
and draw a query tree for the expression.
b. Apply the heuristic optimization transformation rules to find an efficient query
execution plan for the above query. Assume that the number of the suppliers in
New York is larger that the number of the projects with the budgets more than
10000000$.
You are the DBA for the VeryFine Toy Company and create a relation called
8. Employees with fields ename, dept, and salary. For authorization reasons, you also
define views EmployeeNames (with ename as the only attribute) and DeptInfo with
fields dept and avgsalary. The latter lists the average salary for each department
Page 3 of 4
write_item(Y).
Add lock and unlock instructions to transactions T1 and T2, so that they observe the
two-phase locking protocol.
Analyse how the resulting code eliminates – (i) Lost Update (ii) Uncommitted update
(iii) Inconsistent Summary. Justify
Page 4 of 4