DBMS Paper

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

4.

8 Consider the foilowing relational database: (5)


employee(e_name, street, city)
works(e_name, c_name, salary)
company(c_name, city)
manages(e_narne, m_name)
Wri,te Relational Algebra expressions for the following queries:
(i) Find the names and cities of residence of all employees who work for the First
Bank
Corporation.
(i) Find the names, street address, and cities of all employees who work for First Bank
Corporation and earn more than $1O,OOO per annum. Assume each person *o*" foi ai
most one company.
(iii)find the names of all employees in this database who live in the same city as the
company for which they work.
(iv) Find the names of alt employees who tive in the same city and on the same street as
do their managers.
(v) Find the names of all employees in this database who do not work for the First Bank
Corporation. Assume that alt people work for exactly one company.

Q.9 (5)
Consider following schema:
Employee (Employee_name, street, city)
works (Employee_name, company_name, salary)
company (company_name, city)
Manages (Employee_name, manager_name)
write each of the following queries in SeL
(i) Find allEmployees in the database who live in the same city as the companies for
which they work
(ii) Find all employees in the database who live in the same cities and on the same street
as do their managers
(iii) lind allEmployees in the database who do not work for first bank corporation
(iv) Find.all employees in the database who earn more than each emptoyee small bank
corporation

Q.10 Describe three level of DBMS Architecture? Explain referentiat integrity by example. (5)

Q.ll \Mrat is relationship type. Explain cardinality and degree of relationship by example. (s,
PART - C: (Aftempt 3 questions out of 4) Max. Marks (30)
Q.l2 Draw the diagram of system structure of DBMS. Write down the main function of each (r0l
component.
Q.13 Draw ER Diagram and convert.jt into logical database design for Banking Business (iO)
Scenario. Assumptions are as follows :
'There are multiple banks and each bank has many branches. Each branctr has muttiple
customers
. Customers have various types of accounts
' Sorie Customerc also had taken different types of loans from these bank branches
. dne customer can have multiple accounts ind loans

Q.14 Considerthe schema given in Q9 and write each of the following queries in SeL: (f 0)
(i) Find all Employees who earn more than the average satary-oi aii.rfioy"""
of their
company
(ii) Find the company that has the most employees
,(iii) Find the company that has the srnallest payroll
'(iv) Find those com-panies
whose emptoyee eam a high salary on average than the
average salary at small bank corpordion

Q.1s (al Let R = (A, B, C) and let ri ?fid 12 both be relation an schema R. Give an expression in (5)
SQL that is equivalent to each at the following queries:
(i) r, w1
(ii) r, nr,
(iii) 11 - 12
(iv) l-l a.a ( rr ) X Fl a.a ( re )

(b) What is JDBC? Explain establishing a connection to the database. Create statement, (5)
execute query and iterate result set in JDBC.

You might also like