You are on page 1of 3

Kuvempu University

Laboratory Assignments

Subject: RDBMS
Subject Code: BSIT - 32

1. A software company has the following information about its clients and the projects
given by them:

Clients (client number, client name, address)


Projects(project number, project name, total investment, no. of people working on the
project)
Client project(client number, project number, date of start of project)

Create a database with the tables given above. Give suitable field names, keys and
validation checks. Create data entry forms and enter at least 10 rows.

Run the following queries on the above database:


a) List details of projects started after 1st January 2006.
b) List clients who have assigned more than 2 projects to the software company.
c) List clients in order of decreasing total project investment.
d) Show the details of the project with the maximum number of people working on the it.

2. Create the following tables for a movie cassette lending library :

Customer master table : cust


Column name Format Remarks
Cust_id Char(3) Primary key, not null
Last_name Varchar2(15)
First_name Varchar2(20)
Phone_no Number(8)

movie master table: movie


Column name Format Remarks
Movie_no Number(2) Primary key, not null
Movie_title Varchar2(25)
Movie_type Varchar2(10)
Movie_stars Varchar2(40)

invoice transaction table : invoice


Column name Format Remarks
Invoice_no Char(3) Primary key, not null
Movie_no Number(2) Foreign key referencing
movie_no of movie table
Cust_id Char(3) Foreign key referencing cust_id
of cust table
Issue_date Date
Return_date Date

Design data entry forms for the above tables with suitable validations and enter atleast 10
rows.
Execute the following queries:
a) List the names and telephone numbers of all the customers
b) List the movie types available in the movie table.
c) List the information about customers who have been issued movies in the month of
January
d) Which is the last movie issued to customer id ‘C001’
e) List the names of all the movies except of type ‘horror’
f) List of those customers who have not given phone numbers
g) Count the total number of customers
h) List the number of movies in each type
i) Find the movie number issued to the customer ‘Kusum’
j) List the names and movie numbers of all the movies that have been issued
k) List the names of the customers who have been issued the movies of type ‘comedy’
l) List the customers who have been issued movie number 12.
m) List the customer names and phone numbers of all the customers who have been
issued movies before the month of march
n) List the issue_dates and return dates in ‘dd-month-yy’ format
o) Delete the row with invoice number ‘i10’

3. An insurance database has the tables given below. The data types are also specfified.

Table name : owner_details


Column name Format
Owner_id Char(4)
Name Varchar(25)
Address Varchar(40)

Table name : car


Column name Format
Reg_no Char(10)
Model Varchar(15)
Year Number(4)

Table name : accident


Column name Format
Report_no Number(5)
Acc_date Date
Location Varchar(20)

Table name : cars_owners


Column name Format
Owner_id Char(4)
Reg_no Char(10)

Table name : cars_in_accident


Column name Format
Owner_id Char(4)
Reg_no Char(10)
Report_no Number(5)
Cost_of_damage Number(5)

a) Create the above table with proper primary and foreign keys.
b) Enter at least 5 tuples for each relation
c) Update the cost of damage for a particular car involved in an accident with report
number 25 to 30000.
d) Add a new car to the database
e) Add a new accident to the database
f) List the car owners whose cars were involved in accidents in the year 2006
g) Find the number of accidents in which cars of a particular model were involved
h) generate suitable reports

4. A book dealer has the following database:

Author(author_id:interger, author_name:string, city:string, country:string)


Publisher(publisher_id:integer,name:string, city:string, country:string)
Catalog(book_id:integer, title:string, author_id:integer, publisher_id:integer,
year:integer, price:integer)
order_details(order_id:integer, book_id:integer, quantity:integer)

a) Create the tables specified above with suitable primary and foreign keys
b) Create data entry forms and enter at least 5 rows in each table with suitable
validations
c) Find the author of the book which has the maximum sales
d) List the details of the authors who have two or more books in the catalog
e) List all the books in the catalog that have the word ‘COMPUTER’ in their titles
f) Add a new order to the database.

5. An order processing database application in a company has the following tables:

Customer(cust_id:integer, cust_name:string, cust_city:string)


Order(order_id:integer, order_date:date, cust_id:integer, order_amount:real)
Items_ordered(order_id:integer, item_no:integer, quantity:integer)
Item(item_no:integer, unit_price:real)
Shipment(order_id:integer, warehouse_no:integer, date_shipped:date)
Warehouse(warehouse_no:integer, city:string)

a) Create the tables given above with proper primary and foreign key specifications
b) Design data entry forms with proper validations and enter at least 5 rows in each
table
c) List the customer names with their total number of orders and the average
order amount
d) List the orders that were shipped from all the warehouses that the company has in a
particular city
e) Delete item number 15 from the item table and make that column null in the
items_ordered table.
f) Design suitable reports

You might also like