You are on page 1of 5

1. Define the concept of aggregation.

Give an example of where this concept is

useful.

2. Explain the difference between a weak and a strong entity-set.

3. Consider the following database.

Employee (employee-name, street, city)

Works (employee-name, company-name, salary)

Company (company-name, city)

Manager (employee-name, manager-name)

Give an expression in the relational algebra, the tuple relational calculus, and
the

domain relational calculus, for the following query.

Find the names of all employees who work for estate bank. [16]

4.a) Explain in detail the following

i. join operation

ii. Nested - loop join

iii. Block Nested - Loop join.

b) For the following relational database write the expressions in SQL.

Branch Schema (branch name, Branchcity, Assets)

Customer schema(customername, customerstreet, customercity)

Loan schema(Branchname, loan number, Amount)

Borrower schema(customername, loan number)

Account schema (Branchname, Account number, balance)

Depositor schema(customername, Account number)

i. Find the names of all branches in Loan Schema?

ii. Find all customers having loan, account or both at bank?

iii. Display customernames in alphabetical order who have a loan at the Perry

iv. Find set of all customers who have an account at the bank?
5. (a) Explain the distinction among the terms primary key, candidates key and

super key.

(b) Write about the different types of attributes.

(c) What are the two types of constraints in E.R diagram?

6. (a) Distinguish between procedural and non-procedural DML’s.

(b) Define relational algebra, Tuple & Domain relational calculus.

(c) What are the differences between the two types of relational calculus?

7. Write the SQL expressions for the following relational database?

sailor schema (sailor id, Boat id, sailorname, rating, age)

Recerves (Sailor id, Boat id, Day)

Boat Schema (boat id, Boatname, color)

i. Find the age of the youngest sailor for each rating level?

ii. Find the age of the youngest sailor who is eligible to vote for each rating

level with at lead two such sailors?

iii. Find the No.of reservations for each red boat?

iv. Find the average age of sailor for each rating level that at least 2 sailors.

8. a) Why would choose a database system instead of simply storing data in oper-

ating system files ? When would it make sense not to use a database system?

b) What is logical data independence and why is it important?

9. a) What is a relational database query? Explain with an example.

b) What are the SQL constructs to modify the structure of tables, views and to

destroy the tables and views?

10. a) Explain different Binary Operations?

b) For the following relational database, give the expressions in SQL. branch
schema

(branch name, branch city, assets) customer schema (customer name, cus-
tomer street, customer city) Loan schema (branch name, loan number,
amount)

Borrower schema (customer name, Loan number) Account schema (branch

name, account number, balance) Depositer secham (Customer name,


account number)

i. find the names of all customers whos street address include substring

’Main’

ii. Find average balance for each customer who lives in Harrison and at least

three accounts?

iii. . Find all customer who have a loan at bank whose names are neither

?smith? non ?jones’?

11. Consider a bank database with only one relation

Transaction (transno,acctno,date,amount)

The amount attribute values is positive for deposits and negative for
withdrawals.

a) Define an SQL view TP containing the information.

(acctno,T1.date,T2.amouont)

For every pair of transactions T1,T2 such that T1 and T2 are transaction on
the same account and the date of T2 is <=the date of T1.

b) Using only the above view TP, write a querry to find for each account the
minimum balance it ever reached (not including the 0 balance wen the
account is created). Assume there is at most one transaction per day on each
account and each account has had atleast one transaction since it was
created. To simplify your query break it up into 2 steps by defining an
intermediate view V.

12. You need to create a database to store information about U.S. ski areas. You
wish to be
able to look up their regular full day lift-ticket price, total square acres of terrain,
and
vertical feet. At some ski areas, purchasing a lift-ticket gives the ticket-holder the
right
to ski at other partner ski areas as well, and you wish to store that information in
your
database. For each ski area, you also want to be able to access some basic
statistics
about the mountain(s) on which the area is located (specifically, height and average
snowfall).
Draw an E-R diagram for this database, following the notation in this course. Your
diagram should show entities, relationships, and attributes, and should include 1:1,
1:M,
M:M labels. Also denote any mandatory relationships and weak entities in your
model.
13. Consider the following relational database schemas:

COURSES(cno,name)

PRE-REQ(cno,pre-cno)

COMPLETED(studentno,cno)

COURSES gives the number and name of all the vailable courses.

PRE-REQ gives the information about which courses are pre-requisites for
given course.

COMPLETED indicates what courses have been completed by the students.

Express the following using relational algebra:

List all the courses for which a student with student no 2310 has completed
all the pre-requisites.

14. A university placement center maintains a relational database of companies


that interview students on campus and make job offers to those successful in the
interview. The schema of the database is given below:

COMPANY(cname, clocation) STUDENT(sno,sname,sdegree)

INTERVIEW(cname,sno,idate) OFFER(cname,sno,osal)

The company relation gives the name and location of the company. The
STUDENT relation gives the student’s rno,name and the degree program for
which the student is registered in the university. The INTERVIEW relation
gives the date on which a student is interviewed by a company. The OFFER
relation gives the salary offered to a student who is successful in a
company’s interview. The key for each relation is indicated by the underlined
attributes.

a) Write relational algebra expressions for the following queries:


1) List the rnos and names of those students who attended at least one
interview but did not receive any job offer.

2) List the rnos and names of students who went for interviews and received
job offers from every company with which they interviewed.

b) Write an SQL query to list, for each degree program in which more than five
students were offered jobs, the name of the degree and the average offered
salary of students in this degree program.

15. a) Explain the structure of DBMS. b) Explain the life cycle of DBMS.

You might also like