DB 4
DB 4
C) Draw an E-R diagram of Banking system taking into account at least five L3/CO1 6
entities, indicate all keys, constraints and assumptions that are made.
C) Consider the following employee database. Give expression in tuple rela- L3,L5/ 6
tional calculus for each of the following queries. CO2
employee(employee_name,street,city)
works(employee_name,company_name,salary)
company(company_name,city)
manages(employee_name,manager_name)
(i)Find the names of all employees who work for First Bank Corporation.
(ii)Find the names and cities of residence of all employees who work for
First Bank Corporation
(iii)Find all employees who live in the same city as that in which the com-
pany for which the work is located.
(ii) Get employees whose rate of pay is more than or equal to the rate of pay
of employee ‘XYZ’.
(iii) Get the names and pay rates of employees with emp_no less than
123460 whose rate of pay is more than the rate of payoff atleast one em-
ployee with emp_no greater than or equal to 123460.
(ii) Find the names of those cities with temperature and condition whose
condition is neither Sunny nor Cloudy but temperature must be greater than
70.
(iii) Find all the cities with temperature, condition and humidity, whose hu-
midity is in the range of 63 to 79.
C) What is view? What are its advantages? Explain views in SQL with suitable L2/ CO2 6
example.
C) Consider the relation schema R=(A,B,C,G,H,I) and Set of functional de- L3,L4/ 6
pendencies:
CO3
A→B
A→C
CG → H
CG → I
B→H
Compute (AG)+.Is it candidate key? Justify your answer.