Академический Документы
Профессиональный Документы
Культура Документы
(AUTONOMOUS)
DEPARTMENT OF INFORMATION TECHNOLOGY
U14IT302 DATABASE MANAGEMENT SYSTEMS LAB
ASSIGNMENT - 2 QUESTIONS
II - B.TECH IT
SEM: III
(iii) a b (c a, b r) a, c s)
5. Given R {ABCD} and a set F of functional dependencies on R given as
ABC,ABD,CA, DB. Find any two candidate keys of R. Show each step. In what
normal form is R? Justify.
6. Consider the following relations
Employee (E#, Ename, salary, Bdate, D#)
Department (D#, Dname, mgremp#, Location)
Dependent (E#, DependentName)
a. Write tuple calculus queries for the following:
(i) List the names of mangers who have at least one dependent.
(ii) List the names of employees working for research department. (6)
b. Write QBE queries for the following:
(i) List all the employees who earn more than the average salary of all employees.
(ii) Increase the salary of managers by 10%.
(iii) List the names of all employees working in Delhi.
(iv) Change the location of all departments to Mumbai which have location as
Bombay
7. Design a generalization-specialization hierarchy for a motor-vehicle sales company. The
company sells motorcycles which have an engine number and cost; cars which have a
chassis number, an engine number, seating capacity and cost; trucks which have chassis
number, an engine number and cost.
8. Map the following ER diagram to a relational database. Give the relation names and
attributes in them. Also mention the primary key and foreign keys if any for each table.
9.
Give
examples of :
(i) A many to many relationship in which one of the participants is another relationship;
(ii) A subtype that has an associated weak entity that dose not apply to the super Type
10. The entity set EMPLOYEE is a generalization of the entity sets FULL_TIME_EMPLOYEE and
PART_TIME_EMPLOYEE. The former is a generalization of the entity sets FACULTY with
attributes degree and subject of interest and STAFF with attribute classification; the latter, is
a generalization of the entity sets TEACHING with attribute stipend and CASUAL_FACULTY
with
attribute
hour
rate.
STAFF
inherits
the
attribute
Salary
of
the
entity
set
additional
attribute
Salary.
Similarly,
PART_TIME_EMPLOYEE
is
specialization
differentiated by the presence of the attribute Type. Each employee must have attributes
empno, name and hire_date.
(i) Draw an E-R diagram for the system.
(ii) Convert this E-R diagram to relational tables.
11. The tourism department wishes to computerize its data. The information consists of
monuments of tourist interest, their location and history. Monuments are classified according
to historical, religious and architecture importance. The list of facilities available at each
sport is also available. These give (i) living accommodation in terms of hotels, their names,
category and the number of rooms available and (ii) local transport facilities in terms of
service provider name, tours with their tariff and timing. Arrive at an E-R diagram by
identifying the entities, relationships, attributes, primary keys and cardinality.
12. Consider the schema
Airport (code, name, city, country)
Flight (number, airline, from_airport_code, to_airport_code)
Reservation(flight_number, seat_number, date, passenger_name)
Answer the following using relational algebra
(i) List the flight numbers of flights that take off from India
(ii) List the passenger who are on flight number SA 747.
(iii) List all the flight information for Indian Airlines and Jet Airways.
13.
14. Explain Boyce-Codd Normal Form with example and also Compare BCNF and 3NF.
15. Consider the following relations (8)
SALESPERSON(SSN, Name, Start_Year, Dept_No)
TRIP(SSN,From_City,To_City,Departure_Date,Return_Date,Trip_ID)
EXPENSE(Trip_ID, Account#, Amount)
Write queries in relational algebra
(i) Give the details (all attributes to TRIP relation) for the trips that exceeded $2000 in
expenses.
(ii) Print the SSN of salesman who took trips to Chandigarh.
(iii) Print the total trip expenses incurred by the salesman with SSN =234-56-7890.