0% found this document useful (0 votes)
33 views3 pages

D Sample

This tutorial provides instructions on how to: 1. Draw an EER diagram and database schema from information about a bank with branches, customers, accounts, loans, and employees. 2. Briefly explain database transactions including commit and rollback. Discuss the advantages of views and provides an example view. 3. Write SQL queries on accident and performance tables including finding totals, filtering by criteria, and deleting records. 4. Create a stored procedure with a cursor to display records from a table, use a function to calculate totals from the table, and create a trigger to display a message for updates to the student table.

Uploaded by

bingpapa7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views3 pages

D Sample

This tutorial provides instructions on how to: 1. Draw an EER diagram and database schema from information about a bank with branches, customers, accounts, loans, and employees. 2. Briefly explain database transactions including commit and rollback. Discuss the advantages of views and provides an example view. 3. Write SQL queries on accident and performance tables including finding totals, filtering by criteria, and deleting records. 4. Create a stored procedure with a cursor to display records from a table, use a function to calculate totals from the table, and create a trigger to display a message for updates to the student table.

Uploaded by

bingpapa7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Tutorial:

1. Draw an EER diagram for the following given information and obtain the database schema.

A bank is organized into branches. Each branch is located in a particular city and is identified by a
unique name. Each branch maintains its assets.

Bank customers are identified by a unique customer Identification Number. The branch stores
each customer’s Name, Address and Telephone number. Customers may have accounts and can
take loans. A customer may be associated with an employee, who may act as a loan officer or
personal banker for that customer.
Employees are identified by their Employee Numbers. The branch stores the Employee Number,
name, address and telephone no of each employee. The branch also keeps track of the employee’s
start date and the length of the employment.

Each branch offers two types of Accounts: Savings and Current Accounts. Each account is assigned
a unique Account Number. An account can be held by more than one customer, and a customer
can have more than one account. The branch maintains a record of each customer’s balance and
the most Recent Date on which the account was accessed. Savings Accounts are having an Interest
Rate and Current Accounts are having Overdrafts.

A loan is given at a particular branch. A loan is granted to one or more customers and a customer
can get more than one loan. A loan has a number. For each loan, the bank keeps track of the Loan
Amount and the Loan Payments. The Date and the Payment is recorded for each payment.

(State your own assumptions if any)

2.

a. Briefly explain about commit and rollback


b. Mention the advantages of using Views
c. Create a view to display Phno , name from the bellow Emp table

ID Name Address Telephone

111 raj Kandy 01234

d. Explain the usage of view with real time examples ?


3.

a. Consider the following table of an insurance database. Construct the following SQL queries for this
relational database.

accident (report-number, date, location, car_owner,Model)

i) Find the total accidents in 2004 ?


ii) Find the number of accidents in which the cars belonging to “XYZ” were involved.?
iii) Delete the Mazda car information ?

b) Schema’s follows:

Loc (LNO, Dist, Country)


Performance (PNO,Performer_Name, LNO, Capacity)
Write the following queries in SQL
i. Find the names of the artists who performed in Colombo.
ii. Find all locations in India where Mr. X has performed.
iii. List all the artists who played in India.
iv. Performance with the capacity less than 2000.

4.

a. Create a Stored procedure with cursor in oracle to display the records in the Following Table?
EMP
ENO Marks

b) Using the Oracle function calculate the total marks of the above table?

C) Create a trigger to display message when the student table encounters with an update?

** Package/Function/ Procedure

You might also like