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

Third Semester

Name of Paper: Oracle Lab


Course No.: BCA/3/CC/17

Marks Scale: 100 marks (End Sem. Exam: 75+Internal: 25) Credit: 3
(0- 0- 3)

A. Record Book (10 marks)


B. Viva Voce (15 marks)
C. Practical (50 marks)

List of Practicals:
1. Create following Three Tables
I. Salesman
SNUM SNAME CITY COMMISSION
1001 PIYUSH LONDON 12%
1002 NIRAJ SURAT 13%
1003 MITI LONDON 11%
1004 RAJESH BARODA 15%
1005 ANAND NEW DELHI 10%
1006 RAM PATAN 10%
1007 LAXMAN BOMBAY 09%

SNUM: A Unique number assign to each salesman.


SNAME: The name of salesman.
CITY: The location of salesman.
COMMISSION: The salesman commission on order.

II. Customer
CNUM CNAME CITY RATING SNUM
2001 HARDIK LONDON 100 1001
2002 GITA ROME 200 1003
2003 LAXIT SURAT 200 1002
2004 GOVIND BOMBAY 300 1002
2005 CHANDU LONDON 100 1001
2006 CHAMPAK SURAT 300 1007
2007 PRATIK ROME 100 1004

CNUM: A Unique number assign to each customer.


CNAME: The name of customer.
CITY: The location of customer.
RATING: A level of preference indicator given to this customer.
SNUM: A salesman number assign to this customer.

III. Orders
ONUM AMOUNT ODATE CNUM SNUM
3001 18.69 10/03/99 2008 1007
3002 767.19 10/03/99 2001 1001
3003 1900.10 10/03/99 2007 1004
3004 5160.45 10/03/99 2003 1002
3005 1098.25 10/04/99 2008 1007
3006 1713.12 10/04/99 2002 1003
3007 75.75 10/05/99 2004 1002
3008 4723.00 10/05/99 2006 1001
3009 1309.95 10/05/99 2004 1002
3010 9898.87 10/06/99 2006 1001

1.List of all orders for more than Rs. 1000


2. List all customers whose name begins with a letter ‘C’
3. Count all Orders of 10th March 1999
4.List all customers serviced by salesman with commission above 12%.
5.Produce the name and rating of all customers who have above average orders.
6. Double the commission of all salesmen of London
7.Calculate the total of orders for each day.
8. Create a view called Big orders which stores all orders larger than Rs. 4000.
9. Create a view that shows all the customers who have the highest ratings.
10. Remove all orders of customer Chandu from the Orders table

2. Consider the Insurance database given below. The primary keys are underlined and
the data types are specified:
PERSON (driver-id:string,name:string,address:string)
CAR (Regno:string,model:string,year:int)
ACCIDENT (report-number:int,date:date,location:string)
OWNS (driver-id:string,regno:string)
PARTICIPATED (driver-id:string,regno:string,report-number:int,damage-
amount:int)

1. Create the above tables by properly specifying the primary keys and the foreign keys
2. Enter at least five tuples for each relation
3. .Demonstrate how you
a) update the damage amount for the car with a specific regno in accident with
b) report number 12 to 25000
c) add a new accident to the database
4. Calculate the total damage amount
5. Find the lowest and highest amount of money spent in accident.
6. Select location of accident using subquery.
7. Find the total number of people who owned cars that were involved in accidents in
2002.
8. Find the number of accidents in which cars belonging to a specific model were
involved.
9. Create a VIEW called OWNERSHIP that will appear the following :
Driver name, address, registration and location
10. Remove the model column from the CAR table.

3. Consider the following relations for an order processing database applications in a


Company

CUSTOMER (cust:int,cname:string,city:string)
ORDER (order:int,odate:date,cust:int,ord-amt:int)
ORDER_ITEM (order:int,item:int,qty:int)
ITEM (item:int,unitprice:int)
SHIPMENT (order:int,warehouse:int,ship-date:date)
WAREHOUSE (warehouse:int,city:string)

1 Create the above tables by properly specifying the primary keys and the foreign keys
2 Enter at least five tuples for each relation
3 Produce a listing: CUSTNAME,# of orders, AVG_ORDER_AMT, where the middle
column is the total no of orders by the customer and the last column is the average
order amount for that customer
4 List the order # for orders that were shipped from all warehouses that the company
has in a specified city
5 Demonstrate how you delete item #10 from ITEM table and make the field null in the
ORDER_ITEM table.
6 List the orders date, items and unit price.
7 Calculate the total of orders for each day.
8 Find out which unit price is lowest.
9 Create a VIEW called Big which show all orders larger than ` 2000
10 Select unit price in order processing using subquery

4. Consider the following database of student enrollment in courses and books adopted
for each course
STUDENT (regno:string,name:string,major:string,bdate:date)
COURSE (course:int,cname:string,dept:string)
ENROLL (regno:string,course:int,marks:int)
BOOK_ADOPTION (course:int,sem:int,book-ISBN:int)
TEXT (book-ISBN:int,book-title:string,publisher:string,author:string)

1. Create the above tables by properly specifying the primary keys and foreign keys
2. Enter five tuples for each relation
3. Demonstrate how you add a new text book to the database and make this book be
adopted by some department
4. Produce a list of text books in alphabetical order for courses offered by BCA
department that use more than two books
5. List any department that has all its adopted books published by a specific
publisher
6. Select marks of the student using sub query.
7. List out student marks in ascending order
8. Add new column position in enroll table
9. Create a view Black Market that gives the count of no. of publisher.
10. Delete the student bdate from the student table.
5. The following tables are maintained by a book dealer

AUTHOR (author-id:int,name:string,city:string,country:string)
PUBLISHER (publisher-id:int,name:string,city:string,country:string)
CATALOG (book-id:int,title:string,author-id:int,publisher-id:int,category-
id:int,year:int,price:int)
CATEGORY (category-id:int,description:script)
ORDER-DETAILS (order-no:int,book-id:int,quantity:int)

1. Create the above details by properly specifying the primary keys and foreign keys
2. Enter at least five tuples for each relation
3. Find the author of the book which has maximum sales
4. Demonstrate how you increase the price of books published by a specific publisher by
10%
5. List all authors whose name begins with a letter ‘L’.
6. Select the price and author using subquery.
7. Select the order detail ordered by quantity.
8. Shows the total and average quantity of book order
9. Create a view called Booking which shows author name, book id, price, and year
10. Delete the quantity of book orders.

6. Consider the following database for a banking enterprise

BRANCH (branch-name:string,branch-city:string,assets:real)
ACCOUNT (accno:int,branch-name:string,balance:real)
DEPOSITOR (customer-name:string,accno:int)
CUSTOMER (customer-name:string,customer-street:string,city:string)
LOAN (loan-number:int,branch-name:string,loan-number-int)
BORROWER (customer-name:string,customer-street:string,city:string)

1. Create the above tables by properly specifying the primary and foreign keys
2. Enter 5 tuples for each relation
3. Find all the customers who have at least two accounts at the main branch
4. Find all the customers who have an account at all the branches located in a
specified city
5. Find the average loan taken by each customer in any branch
6. Select the borrower name and balance using sub query.
7. Find the lowest and highest balance in account table.
8. Find the customer Sanjit take loan from the Noida branch.
9. Create a view called Personal loan that shows customer name, account no and
loan
10. demonstrate how you delete all account tuples at every branch located in a
specified city

Note:The above lists of experiments are suggestive of the standard. Department may modify,
add or delete any experiment whenever it considered necessary

You might also like