Anda di halaman 1dari 157

Ex.

No 1:
1.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints

Insert around 10 records in each of the tables

List all the bills for the current date with the customer names and item numbers

2. Write functions/procedures for the following based on the table employee
3. Generate one example using Text,Label,Command Button controls and also write appropriate
events for all the controls

Ex no: 2
1. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

List the total Bill details with the quantity sold, price of the item and the final amount

List the details of the customer who have bought a product which has a price>200

Give a count of how many products have been bought by each customer
2. Search for an employee code and return name, designation and deptno.
3. Create an Application Using Option Button and Check Boxes

Ex no: 3
1. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

Give a list of products bought by a customer having cust_id as 5

List the item details which are sold as of today

Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
2. Prepare a salary slip for the given employee code.
3. Create an application Using Different Combo and List Box controls




Ex no: 4
1. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
a) Create the tables with the appropriate integrity constraints
b) Insert around 10 records in each of the tables
c) List all the student names with their membership numbers

2. Generate one example using Data Control and also write appropriate events for that
3. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 5
1. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

d) List all the issues for the current date with student and Book names
e) List the details of students who borrowed book whose author is CJDATE
f) Give a count of how many books have been bought by each student

2. Create a Calculator Application
3. Write a PL/SQL program to find the factorial of a number.

Ex no: 6
1. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

g) Give a list of books taken by student with stud_no as 5
h) List the book details which are issued as of today
i) Create a view which lists out the iss_no, iss _date, stud_name, book name
j) Create a view which lists the daily issues-date wise for the last one week

2. Create an application using Different Grid Controls
3. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.








Ex no: 7
1. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
a) Create the tables with the appropriate integrity constraints
b) Insert around 10 records in each of the tables
c) List the employee details department wise

2. Generate one example without using Data Control
3. Write a PL/SQL program to find the total and average of 4 subjects and display the grade

Ex no: 8
1. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
d) List all the employee names who joined after particular date
e) List the details of employees whose basic salary is between 10,000 and 20,000
f) Give a count of how many employees are working in each department

2. Create an application using Horizantal and Vertical Scroll Bars
3. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 9
1. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
g) Give a names of the employees whose netsalary>10,000
h) List the details for an employee_id=5
i) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
2. Create an application using Menus
3. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS





Ex no: 10.
1. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

2. Create an application Using MDI form with Toolbar control
3. Write a PL/ SQL program to generate Fibonacci series

Ex no: 11
1. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

2. To Write a PL/SQL Program to display the number in Reverse Order.
3. Create an Application Using DirListbox, DriveListbox , File Listbox controls

Ex no: 12
1. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

2. Create an application Using Popup Menus
3. To write a PL/SQL program to a function for finding the factorial of given number









Ex no: 13
1. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

2. write a PL/SQL block to apply string functions on a given input string
3. Create an application Using Shape and Timer controls

Ex no: 14
1. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

2. You need to create a multiple choice quiz with at least 5 questions. The quiz can be about
anything you want (keep it clean). You only need to have 3 possible answers for each
question. You will keep score using an equation that adds up the correct answer.
3. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 15
1. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

2. The graduating class is selling blank CD's in bulk and they want a quick way to add up a
customer's order. If people buy less than 25 CD's, they will cost$1.25 each. But if someone
wants more than 25, the cost will be 75 cents each. Each order will need 15% tax added on.
Then you will need to add the cost of the order to the tax in order to get the customer's total
cost.
3. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
1. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
2. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
3. Lawn has its first bank machine-well, sort of. You are going to create a program that takes the
current account balance and the amount you wish to withdraw and computes the transaction.
If you don't have enough money, or if your balance gets too low, the ATM will let you know.

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending
order of number of employees.
2. Since it's close to report card time, in this lab you will create a program that will write a
program that will convert your averages into letter grades. When the program runs, you
should be able to enter a number into the textbox, click the correct button and have a letter
grade appear in the picture box:
F- Anything under 50
D- Anything from 50 to 55
C- Anything from 56 to 64
B- Anything from 65 to 79
A- Anything from 80 to 100

3. Write a PL/SQL program to swap two numbers









Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
2. In this lab you will be building a program for converting Imperial measurements (miles,
yards, feet inches) to kilometers, meters and centimeters.Your program will take information
from textboxes, perform a calculation and display the results to a picture box.You will be
using the FormatNumber function to round off some of the numbers you will be calculating.
3. Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1. Display the marks of the student number 1 which are equal to the
marks of the student number
2. This lab will give you a chance to work with calculations in Visual Basic and learn how to
use one of Visual Basic's built in functions, "INT". The "INT" function is used when you
have a number with a decimal. "INT" takes whatever appears before the decimal and
displays it to your screen.
3. Write a PL/SQL program to find the total and average of 6 subjects and display the grade


Ex no: 20
1. Finding the names of everybody who works in the same department as
a person called James
2. In Visual Basic, there are a group of built-in functions that perform different tasks for you
that you may need from time to time. One of these is called "Len", which tells you how many
letters are in a particular word typed into a textboxIn this fairly simple lab, you are going to
use the Len function. Also, you are going to use an INPUT BOX for the first time. When
called, this lets you enter information and send it to certain places.


3. Write a PL/SQL program to find the sum of digits in a given numbe


Ex no: 21
1. The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
2. A function is like a mini-program within the bigger program that you can call over and over
when you need it. Instead of typing the same code for several buttons, you can write a
function, give it a name, then use a simple line of code to put it to work when you need it.In
this lab you will create some functions that will calculate averages for 3 students, then
calculate a class average.
5 textboxes for you to enter test marks into
3 buttons for you to program to calculate the marks for each student
3 labels for you to display the averages in once they are calculated
A button to clear the textboxes so you can enter marks for the next student (Next Student)
A button to calculate the class average
A label to display the class average
A button to end the program
3. Write a PL/SQL program to display the number in reverse order




Ex no: 22
1. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and the
department(consider distinct values). dept_cap contains the capacity for each department. We
need to find those departments(DEPT) where the number of students is less than the total
capacity of the department.
2. Create a form with the following objects:
5 textboxes
8 labels, called the following:
"Welcome to the HNMA Canteen"
Chips: $1.00
Ice Cream: $0.75
Water: $1.00
Small Milk: $0.45
Large Milk: $0.80
"Enter the quantity here:"
"Your Total:"
- Leave the 8th one blank and change the border style to "Fixed Single"
- buttons, called the following:
Calculate Total
Clear All
Exit
-
3. Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from
3 to 7. Store the radius and the corresponding values of calculated area in an empty table
named areas, consisting of two columns radius & area

Ex no: 23
1. A database is being constructed for storing sales information system. A product can be
described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
2. Explain the use of options in Property Window in VB

3. Write a PL/SQL code block that will accept an account number from the user, check if the
users balance is less than minimum balance, only then deduct rs.100/- from the balance. This
process is fired on the acct table

Ex no: 24
1. Write the SQL queries for the following
Retrieve the list of names and the cities of all the clients.
List the various products available.
Find the names of all clients having a as the second letter in their names.
2. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
3. Create a program with:


-only textbox containing the words" Visual Basic" in bold, centralized whiteletter and red
background.

Ex no: 25
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
2. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
3. Write a program that parses a name:

Ex no: 26
1. Write the SQL queries for the following
Rename the column product_rate of Sales_Order_Details tonew_product_rate.
List the products in sorted order of their description.
Display the order number and date on which the clients placed their order.
2. PL/SQL Program to Display the Fibonacci Series From 1 to 10
3. Write a VB program to
Create a Sequential File
Add Items to a Sequential File

Ex no: 27
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000
3.Write program using if clause or else if clause.

Ex no: 28
1. Write the SQL queries for the following
Find the product with description as HDD1034 and DVDRW
List the names, city and state of the clients not in the state of ASSAM
List of all orders that were cancelled in the of March.
2. Writing a program using Select Case.
3. PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 29
1. Write a program using List boxes and combo boxes
2. A student is described by a unique Roll Number, Name Address, and Semester. Each student
enrols himself in an Academic programme offered by a Department. Academic programmes have
programme name(unique), duration, a programme code(unique) and a list of courses (both core
and elective course) while the departments have department code (unique), department name
(unique), HoD who is a Teacher and list of courses offered by it. Each teacher is described by
employee code (unique), name, department and designation. A student registers some courses in a
semester. A course is described by a unique course number, title of the course, credit allotted for
the course and offering department. Database stores the grades obtained by different student in
different courses registered by him/her in different semesters. Database also stores information
about the courses offered by a department in a semester, the corresponding teacher(s) for
each course.
3. PL/SQL Program that Accepts a Number and Find the Factorial


Ex no: 30
1.Write program to compare procedure and sub procedure
2.Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3.PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 31
1.Write Program using Repetitions (Loops).
2.Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3.PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 32
1. Write program for Processing Lists of Data with Do Loops
Peek Method
Counters and Accumulators
2. Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
Retrieve the semester of the student under DBMS subject
3. PL/SQL Program that Accepts a Number and Prints its Binary Format

Ex no: 33
1. Write a VB Program to display the Total content of the file.
2. Write the SQL queries for the following
Retrieve all the student names, and arrange into ascending order.
Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
Find the total credit point of student required to complete for a course like MCA.
3. PL/SQL Program to Calculate the Compound Interest

Ex no: 34
1. Develop database applications to access a database with a data table
2. Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3. PL/SQL Program to Calculate the Sum of 1!+2!++n!

Ex no: 35

1. Develop database applications to access a database with a list box
2. A bank database keeps record of the details of customers, accounts, loans and transactions
such as deposits or withdraws. Customer record should includecustomer id, customer name,
address, age, contact number, email id etc.,accounts details involves account number, account
type(fixed account, savingsaccount, monthly account etc), date of creation of the account. Transaction
detail keeps information about amount deposited or withdrawn to/from a particularaccount and the
date of transaction. The database should also store record ofloans which include loan amount, loan
date and the account number to which theloan is granted.Make appropriate tables for the above
database and try to find out the followingqueries:
1. List the details of account holders who have a savings account.
2. List the Name and address of account holders with loan amount more than 50,000.
3. Change the name of the customer to ABC whose account number is TU001
3. PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n
Ex no: 36
1. Write a java program to show just the records that meet certain criteria and Join between two
tables.
2. A bank database keeps record of the details of customers, accounts, loans and transactions
such as deposits or withdraws. Customer record should includecustomer id, customer name,
address, age, contact number, email id etc.,accounts details involves account number, account
type(fixed account, savingsaccount, monthly account etc), date of creation of the account. Transaction
detail keeps information about amount deposited or withdrawn to/from a particularaccount and the
date of transaction. The database should also store record ofloans which include loan amount, loan
date and the account number to which theloan is granted.Make appropriate tables for the above
database and try to find out the followingqueries:
1. List the account number with total deposit more than 80,000.
2. List the number of fixed deposit accounts in the bank.
3. Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3. PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!

Ex no: 37
1. Develop database applications to access a database with a data table, data grid view and change the
contents of a database.
2 .A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
1. Display the detailed transactions on 28th Aug, 2008.
2. Display the total amount deposited and withdrawn on 29th Aug, 2008.
3. List the details of customers who have a loan.
3. PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 38
1. Write a program using insert sql statement
2. Library information system: Database should store information about books, journals, mgazines
etc. Searching for books can be done by author, title, and subject. Similarly journals canbe searched
by subject area, publisher etc. It should also be possible to see whichbook is issued to which student
and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3. Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 39
1. Develop applications with multiple forms
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 40
1.Design, create, test and debug fully functioning programs using the new Visual Basic.Net language.
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3.Write a program to demonstrate %type and %rowtype attributes

Ex no: 41
1.Write a program to display numbers in a list box.
2.Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including results)
prescribed topatients, information if a patient if referred to other expert/hospital. Doctors -
specialization, patients attended etc. Different wards/beds and patients allotted tothem etc. Patient
registration form should include Registration number, Patient name,Address, Gender, Bed number,
date of registration, refer doctor id etc.Doctor information should include Doctor Code, Doctor Name,
and Specializationetc.Lab test information should include Test name, test number, test date, results
andreferred doctors code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3.Write a program to demonstrate predefined exceptions

Ex no: 42
1.Write a program to read data from a file.
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3.Write a program to demonstrate user defined exceptions

Ex no: 43
1.Develop an application for college management system.
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3.create a procedure which generate all the prime numbers below the given number and count
the no.of prime numbers.

Ex no: 44
1.Table Name: Employee









1. Get all employee details from the employee table
2. Get First_Name,Last_Name from employee table
3. Get First_Name from employee table using alias name Employee Name


2.Develop an application for attendance management system.
3.create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/







EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance


Ex no: 45
1.Table Name: Employee






1. Get First_Name from employee table in upper case
2. Get First_Name from employee table in lower case
3. Get unique DEPARTMENT from employee table.
4. Select first 3 characters of FIRST_NAME from EMPLOYEE
2.De
velo
p an
appli
catio
n for
daily
colle
ction
syste
m.
3
3. Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.












Ex no: 46
1. Develop an application for billing system.
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance

For the above schema, perform the following
a) Create the tables with the appropriate integrity constraints
b) Insert around 10 records in each of the tables
c) List all the machine allotments with the student names, lab and machine numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 47
1.Develop an application to access database using the ADO Data Control.
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
a) Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
b) How many students class wise have allocated machines in the labs
c) Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
d) Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
d) List the total number of lab allotments day wise
e) Give a count of how many machines have been allocated to the CSIT class
f) Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 48
1.Create a simple HelloWorld ActiveX control in Visual Basic.
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
a) Create the tables with the appropriate integrity constraints
b) Insert around 10 records in each of the tables
c) List all the bills for the current date with the customer names and item numbers
d) List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 49
1.Program to demonstrate dragging and dropping form explorer and between forms and also includes
a cool control moving code module.
2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
e) Give a count of how many products have been bought by each customer
f) Give a list of products bought by a customer having cust_id as 5
g) List the item details which are sold as of today
3.Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 50
1.Develop an application for Apartment management system.
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
h) Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
i) Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department

Ex. No: 51
1.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints

Insert around 10 records in each of the tables

List all the bills for the current date with the customer names and item numbers

2. Write functions/procedures for the following based on the table employee
4. Create a Calculator Application

Ex no: 52
4. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and the
department(consider distinct values). dept_cap contains the capacity for each department.
We need to find those departments(DEPT) where the number of students is less than the
total capacity of the department.
5. Create an application Using Shape and Timer controls
-
3.Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from 3 to 7.
Store the radius and the corresponding values of calculated area in an empty table named areas,
consisting of two columns radius & area

Ex no: 53
1. A database is being constructed for storing sales information system. A product can be
described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
2. Create an application Using Shape and Timer controls

3. Write a PL/SQL code block that will accept an account number from the user, check if the
users balance is less than minimum balance, only then deduct rs.100/- from the balance. This
process is fired on the acct table

Ex no: 54
1. Write the SQL queries for the following
Retrieve the list of names and the cities of all the clients.
List the various products available.
Find the names of all clients having a as the second letter in their names.
2. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
3. Create an application Using Shape and Timer controls


Ex no: 55
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
2. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
3. Create an application Using Shape and Timer controls

Ex no: 56
1. Write the SQL queries for the following
Rename the column product_rate of Sales_Order_Details tonew_product_rate.
List the products in sorted order of their description.
Display the order number and date on which the clients placed their order.
2. PL/SQL Program to Display the Fibonacci Series From 1 to 10
3. Create an application Using Shape and Timer controls

Ex no: 57
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000.
3. Create an application Using Shape and Timer controls


Ex no: 58
1. Write the SQL queries for the following
Find the product with description as HDD1034 and DVDRW
List the names, city and state of the clients not in the state of ASSAM
List of all orders that were cancelled in the of March.
2. Create an application Using Shape and Timer controls
3. PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 59
1. Create an application Using Shape and Timer controls
2. A student is described by a unique Roll Number, Name Address, and Semester. Each student
enrols himself in an Academic programme offered by a Department. Academic programmes
have programme name(unique), duration, a programme code(unique) and a list of courses
(both core and elective course) while the departments have department code (unique),
department name (unique), HoD who is a Teacher and list of courses offered by it. Each
teacher is described by employee code (unique), name, department and designation. A student
registers some courses in a semester. A course is described by a unique course number, title
of the course, credit allotted for the course and offering department. Database stores the
grades obtained by different student in different courses registered by him/her in different
semesters. Database also stores information about the courses offered by a department
in a semester, the corresponding teacher(s) for each course.
3. PL/SQL Program that Accepts a Number and Find the Factorial

Ex no: 60
1. Create an application Using Shape and Timer controls
2. Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3. PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 61
1. Create an application Using Shape and Timer controls
2. Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3. PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 62
1. Create an application Using Shape and Timer controls
2. Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
Retrieve the semester of the student under DBMS subject
3. PL/SQL Program that Accepts a Number and Prints its Binary Format




Ex no: 63
1. Create an application Using Shape and Timer controls
2.Write the SQL queries for the following
Retrieve all the student names, and arrange into ascending order.
Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
Find the total credit point of student required to complete for a course like MCA.
3.PL/SQL Program to Calculate the Compound Interest

Ex no: 64
1. Create an application Using Shape and Timer controls
2.Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3.PL/SQL Program to Calculate the Sum of 1!+2!++n!

Ex no: 65
1. Create an application Using Shape and Timer controls
2. A bank database keeps record of the details of customers, accounts, loans and transactions
such as deposits or withdraws. Customer record should includecustomer id, customer
name, address, age, contact number, email id etc.,accounts details involves account
number, account type(fixed account, savingsaccount, monthly account etc), date of creation of
the account. Transaction detail keeps information about amount deposited or withdrawn
to/from a particularaccount and the date of transaction. The database should also store record
ofloans which include loan amount, loan date and the account number to which theloan is
granted.Make appropriate tables for the above database and try to find out the
followingqueries:
List the details of account holders who have a savings account.
List the Name and address of account holders with loan amount more than 50,000.
Change the name of the customer to ABC whose account number is TU001
3. PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n

Ex no: 66
1. Create an application Using Shape and Timer controls
2. A bank database keeps record of the details of customers, accounts, loans and transactions
such as deposits or withdraws. Customer record should includecustomer id, customer
name, address, age, contact number, email id etc.,accounts details involves account
number, account type(fixed account, savingsaccount, monthly account etc), date of creation of
the account. Transaction detail keeps information about amount deposited or withdrawn
to/from a particularaccount and the date of transaction. The database should also store record
ofloans which include loan amount, loan date and the account number to which theloan is
granted.Make appropriate tables for the above database and try to find out the
followingqueries:
List the account number with total deposit more than 80,000.
List the number of fixed deposit accounts in the bank.
Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3. PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!




Ex no: 67
1. Create an application Using Shape and Timer controls
2. A bank database keeps record of the details of customers, accounts, loans and transactions
such as deposits or withdraws. Customer record should includecustomer id, customer
name, address, age, contact number, email id etc.,accounts details involves account
number, account type(fixed account, savingsaccount, monthly account etc), date of creation of
the account. Transaction detail keeps information about amount deposited or withdrawn
to/from a particularaccount and the date of transaction. The database should also store record
ofloans which include loan amount, loan date and the account number to which theloan is
granted.Make appropriate tables for the above database and try to find out the
followingqueries:
Display the detailed transactions on 28th Aug, 2008.
Display the total amount deposited and withdrawn on 29th Aug, 2008.
List the details of customers who have a loan.
3. 3. PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 68
1. Create an application Using Shape and Timer controls
2. Library information system: Database should store information about books, journals,
mgazines etc. Searching for books can be done by author, title, and subject. Similarly journals
canbe searched by subject area, publisher etc. It should also be possible to see whichbook is
issued to which student and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3. Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 69
1. Create an application Using Shape and Timer controls
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 70
1. Create an application Using Shape and Timer controls
2. Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3. Write a program to demonstrate %type and %rowtype attributes

Ex no: 71
1. Create an application Using Shape and Timer controls
2. Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including
results) prescribed topatients, information if a patient if referred to other expert/hospital.
Doctors -specialization, patients attended etc. Different wards/beds and patients allotted
tothem etc. Patient registration form should include Registration number, Patient
name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test
information should include Test name, test number, test date, results andreferred doctors
code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3. Write a program to demonstrate predefined exceptions

Ex no: 72
1. Create an application Using Shape and Timer controls
2. Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3. Write a program to demonstrate user defined exceptions

Ex no: 73
1. Create an application Using Shape and Timer controls
2. Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3. create a procedure which generate all the prime numbers below the given number and
count the no.of prime numbers.


Ex no: 74
1. Table Name: Employee











4. 0Get all employee details from the employee table
5. Get First_Name,Last_Name from employee table
6. Get First_Name from employee table using alias name Employee Name













2. Create an application Using Shape and Timer controls
3. create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/

Ex no: 75
1.Table Name: Employee






5. Get First_Name from employee table in upper case
6. Get First_Name from employee table in lower case
7. Get unique DEPARTMENT from employee table.
8. Select first 3 characters of FIRST_NAME from EMPLOYEE
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500


4. Create an application Using Shape and Timer controls
3.Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.

Ex no: 76
1. Create an application Using Shape and Timer controls
2. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine
numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor.
The Program is to find out the salary of an employee from emp table whose two
fields are emp_sal and emp_no.

Ex no:77
1. Create an application Using Shape and Timer controls
2. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 78
1. Create an application Using Shape and Timer controls

2. Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the bills for the current date with the customer names and item numbers
List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 79
1. Create an application Using Shape and Timer controls
2. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Give a count of how many products have been bought by each customer
Give a list of products bought by a customer having cust_id as 5
List the item details which are sold as of today
3. Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 80
1. Create an application Using Shape and Timer controls
2. Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department


Ex. No: 81
1. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the bills for the current date with the customer names and item numbers
2. Write functions/procedures for the following based on the table employee
3. Explain the use of options in Property Window in VB


Ex no: 82
1. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)
List the total Bill details with the quantity sold, price of the item and the final amount
List the details of the customer who have bought a product which has a price>200
Give a count of how many products have been bought by each customer
2. Search for an employee code and return name, designation and deptno.
3. Explain the use of options in Property Window in VB

Ex no: 83
1. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)
Give a list of products bought by a customer having cust_id as 5
List the item details which are sold as of today
Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
3. Prepare a salary slip for the given employee code.
4. Explain the use of options in Property Window in VB

Ex no: 84
4. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
k) Create the tables with the appropriate integrity constraints
l) Insert around 10 records in each of the tables
m) List all the student names with their membership numbers

5. Explain the use of options in Property Window in VB
6. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 85
4. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

n) List all the issues for the current date with student and Book names
o) List the details of students who borrowed book whose author is CJDATE
p) Give a count of how many books have been bought by each student

5. Explain the use of options in Property Window in VB
6. Write a PL/SQL program to find the factorial of a number.

Ex no: 86
4. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

q) Give a list of books taken by student with stud_no as 5
r) List the book details which are issued as of today
s) Create a view which lists out the iss_no, iss _date, stud_name, book name
t) Create a view which lists the daily issues-date wise for the last one week

5. Explain the use of options in Property Window in VB
6. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.

Ex no: 87
4. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
j) Create the tables with the appropriate integrity constraints
k) Insert around 10 records in each of the tables
l) List the employee details department wise

5. Explain the use of options in Property Window in VB
6. Write a PL/SQL program to find the total and average of 4 subjects and display the grade



Ex no: 88
1.2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

List the total Bill details with the quantity sold, price of the item and the final amount

List the details of the customer who have bought a product which has a price>200

Give a count of how many products have been bought by each customer
4. Search for an employee code and return name, designation and deptno.
5. Create a Calculator Application

Ex no: 89
5. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

Give a list of products bought by a customer having cust_id as 5

List the item details which are sold as of today

Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
6. Prepare a salary slip for the given employee code.
7. Create a Calculator Application

Ex no: 90
7. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
u) Create the tables with the appropriate integrity constraints
v) Insert around 10 records in each of the tables
w) List all the student names with their membership numbers

8. Create a Calculator Application
9. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 91
7. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

x) List all the issues for the current date with student and Book names
y) List the details of students who borrowed book whose author is CJDATE
z) Give a count of how many books have been bought by each student

8. Generate one example using Text,Label,Command Button controls and also write appropriate
events for that
9. Write a PL/SQL program to find the factorial of a number.

Ex no: 92
7. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

aa) Give a list of books taken by student with stud_no as 5
bb) List the book details which are issued as of today
cc) Create a view which lists out the iss_no, iss _date, stud_name, book name
dd) Create a view which lists the daily issues-date wise for the last one week

8. Create a Calculator Application
9. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.

Ex no: 93
7. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
m) Create the tables with the appropriate integrity constraints
n) Insert around 10 records in each of the tables
o) List the employee details department wise

8. Create a Calculator Application
9. Write a PL/SQL program to find the total and average of 4 subjects and display the grade

Ex no: 94
4. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
p) List all the employee names who joined after particular date
q) List the details of employees whose basic salary is between 10,000 and 20,000
r) Give a count of how many employees are working in each department

5. Create a Calculator Application
6. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 95
4. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
s) Give a names of the employees whose netsalary>10,000
t) List the details for an employee_id=5
u) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
5. Create a Calculator Application
6. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS

Ex no: 96.
4. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

5. Create a Calculator Application
6. Write a PL/ SQL program to generate Fibonacci series

Ex no: 97
4. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

5. Create a Calculator Application
6. Create an Application Using DirListbox, DriveListbox , File Listbox controls

Ex no: 98
4. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

5. Create a Calculator Application
6. To write a PL/SQL program to a function for finding the factorial of given number

Ex no: 99
4. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

5. write a PL/SQL block to apply string functions on a given input string
6. Create a Calculator Application

Ex no: 100
4. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

5. Create a Calculator Application
6. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 101
4. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

5. Create a Calculator Application
6. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
4. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
5. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
6. Create a Calculator Application

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending order of
number of employees.
4. Create a Calculator Application
3.Write a PL/SQL program to swap two numbers

Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
5. Create a Calculator Application
3.Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1.Display the marks of the student number 1 which are equal to the
marks of the student number 2.
6. Create a Calculator Application
3.Write a PL/SQL program to find the total and average of 6 subjects and display the grade
Ex no: 20
1.Finding the names of everybody who works in the same department as
a person called James
7. Create a Calculator Application


3.Write a PL/SQL program to find the sum of digits in a given numbe
Ex no: 21
1.The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
8. Create a Calculator Application
3.Write a PL/SQL program to display the number in reverse order

Ex no: 22
9. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and the
department(consider distinct values). dept_cap contains the capacity for each department. We
need to find those departments(DEPT) where the number of students is less than the total
capacity of the department.
10. Create a Calculator Application
-
3.Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from 3 to 7.
Store the radius and the corresponding values of calculated area in an empty table named areas,
consisting of two columns radius & area
Ex no: 23
11. A database is being constructed for storing sales information system. A product can be
described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
12. Create a Calculator Application

13. Write a PL/SQL code block that will accept an account number from the user, check if the
users balance is less than minimum balance, only then deduct rs.100/- from the balance. This
process is fired on the acct table

Ex no: 24
1. Write the SQL queries for the following
14. Retrieve the list of names and the cities of all the clients.
15. List the various products available.
16. Find the names of all clients having a as the second letter in their names.
17. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
18. Create a Calculator Application

Ex no: 25
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
19. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
20. Create a Calculator Application

Ex no: 26
1. Write the SQL queries for the following
2. Rename the column product_rate of Sales_Order_Details tonew_product_rate.
3. List the products in sorted order of their description.
4. Display the order number and date on which the clients placed their order.
21. PL/SQL Program to Display the Fibonacci Series From 1 to 10
22. Create a Calculator Application
Ex no: 27
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000
23. Create a Calculator Application

Ex no: 28
1.Write the SQL queries for the following
1. Find the product with description as HDD1034 and DVDRW
2. List the names, city and state of the clients not in the state of ASSAM
3. List of all orders that were cancelled in the of March.
4. Create a Calculator Application
3.PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 29
24. Create a Calculator Application
25. A student is described by a unique Roll Number, Name Address, and Semester. Each student
enrols himself in an Academic programme offered by a Department. Academic programmes
have programme name(unique), duration, a programme code(unique) and a list of courses
(both core and elective course) while the departments have department code (unique),
department name (unique), HoD who is a Teacher and list of courses offered by it. Each
teacher is described by employee code (unique), name, department and designation. A student
registers some courses in a semester. A course is described by a unique course number, title
of the course, credit allotted for the course and offering department. Database stores the
grades obtained by different student in different courses registered by him/her in different
semesters. Database also stores information about the courses offered by a department
in a semester, the corresponding teacher(s) for each course.
3.PL/SQL Program that Accepts a Number and Find the Factorial
Ex no: 30
26. Create a Calculator Application
2.Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3.PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 31
27. Create a Calculator Application
2.Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3.PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 32
28. Create a Calculator Application
2.Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
3. Retrieve the semester of the student under DBMS subject
3.PL/SQL Program that Accepts a Number and Prints its Binary Format

Ex no: 33
29. Create a Calculator Application
2.Write the SQL queries for the following
4. Retrieve all the student names, and arrange into ascending order.
5. Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
6. Find the total credit point of student required to complete for a course like MCA.
3.PL/SQL Program to Calculate the Compound Interest
Ex no: 34
30. Create a Calculator Application
2.Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3.PL/SQL Program to Calculate the Sum of 1!+2!++n!
Ex no: 35
31. Create a Calculator Application
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
4. List the details of account holders who have a savings account.
5. List the Name and address of account holders with loan amount more than 50,000.
6. Change the name of the customer to ABC whose account number is TU001
3.PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n

Ex no: 36
32. Create a Calculator Application
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
4. List the account number with total deposit more than 80,000.
5. List the number of fixed deposit accounts in the bank.
6. Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3.PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!

Ex no: 37
33. Create a Calculator Application
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
4. Display the detailed transactions on 28th Aug, 2008.
5. Display the total amount deposited and withdrawn on 29th Aug, 2008.
6. List the details of customers who have a loan.
3.PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 38
34. Create a Calculator Application
2.Library information system: Database should store information about books, journals, mgazines
etc. Searching for books can be done by author, title, and subject. Similarly journals canbe searched
by subject area, publisher etc. It should also be possible to see whichbook is issued to which student
and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3.Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 39
35. Create a Calculator Application
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 40
36. Create a Calculator Application
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3.Write a program to demonstrate %type and %rowtype attributes
Ex no: 41
37. Create a Calculator Application
2.Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including results)
prescribed topatients, information if a patient if referred to other expert/hospital. Doctors -
specialization, patients attended etc. Different wards/beds and patients allotted tothem etc. Patient
registration form should include Registration number, Patient name,Address, Gender, Bed number,
date of registration, refer doctor id etc.Doctor information should include Doctor Code, Doctor Name,
and Specializationetc.Lab test information should include Test name, test number, test date, results
andreferred doctors code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3.Write a program to demonstrate predefined exceptions
Ex no: 42
38. Create a Calculator Application
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3.Write a program to demonstrate user defined exceptions
Ex no: 43
39. Create a Calculator Application
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3.create a procedure which generate all the prime numbers below the given number and count
the no.of prime numbers.
Ex no: 44
1.Table Name: Employee

EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000














40. 0Get all employee details from the employee table
41. Get First_Name,Last_Name from employee table
42. Get First_Name from employee table using alias name Employee Name


43. Create a Calculator Application
3.create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/

Ex no: 45
1.Table Name: Employee






2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance






9. Get
First_Name from employee table in upper case
10. Get First_Name from employee table in lower case
11. Get unique DEPARTMENT from employee table.
12. Select first 3 characters of FIRST_NAME from EMPLOYEE








44. Create a Calculator Application
3.Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.

Ex no: 46
45. Create a Calculator Application
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
g) Create the tables with the appropriate integrity constraints
h) Insert around 10 records in each of the tables
i) List all the machine allotments with the student names, lab and machine numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 47
46. Create a Calculator Application
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
e) Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
f) How many students class wise have allocated machines in the labs
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance
g) Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
h) Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
j) List the total number of lab allotments day wise
k) Give a count of how many machines have been allocated to the CSIT class
l) Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 48
47. Create a Calculator Application
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
c) Create the tables with the appropriate integrity constraints
d) Insert around 10 records in each of the tables
j) List all the bills for the current date with the customer names and item numbers
k) List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 49
48. Create a Calculator Application
2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
l) Give a count of how many products have been bought by each customer
m) Give a list of products bought by a customer having cust_id as 5
n) List the item details which are sold as of today
3.Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 50
49. Create a Calculator Application
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
o) Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
p) Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department

Part 3
Ex. No 1:
1.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints

Insert around 10 records in each of the tables

List all the bills for the current date with the customer names and item numbers

2. Write functions/procedures for the following based on the table employee
50. Create an application using Menus

Ex no: 2
1.2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

List the total Bill details with the quantity sold, price of the item and the final amount

List the details of the customer who have bought a product which has a price>200

Give a count of how many products have been bought by each customer
6. Search for an employee code and return name, designation and deptno.
7. Create an application using Menus

Ex no: 3
8. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

Give a list of products bought by a customer having cust_id as 5

List the item details which are sold as of today

Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
9. Prepare a salary slip for the given employee code.
10. Create an application using Menus

Ex no: 4
10. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
ee) Create the tables with the appropriate integrity constraints
ff) Insert around 10 records in each of the tables
gg) List all the student names with their membership numbers

11. Create an application using Menus
12. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 5
10. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

hh) List all the issues for the current date with student and Book names
ii) List the details of students who borrowed book whose author is CJDATE
jj) Give a count of how many books have been bought by each student

11. Create an application using Menus
12. Write a PL/SQL program to find the factorial of a number.

Ex no: 6
10. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

kk) Give a list of books taken by student with stud_no as 5
ll) List the book details which are issued as of today
mm) Create a view which lists out the iss_no, iss _date, stud_name, book name
nn) Create a view which lists the daily issues-date wise for the last one week

11. Create an application using Menus
12. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.

Ex no: 7
10. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
v) Create the tables with the appropriate integrity constraints
w) Insert around 10 records in each of the tables
x) List the employee details department wise

11. Create an application using Menus
12. Write a PL/SQL program to find the total and average of 4 subjects and display the grade

Ex no: 8
7. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
y) List all the employee names who joined after particular date
z) List the details of employees whose basic salary is between 10,000 and 20,000
aa) Give a count of how many employees are working in each department

8. Create an application using Menus
9. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 9
7. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
bb) Give a names of the employees whose netsalary>10,000
cc) List the details for an employee_id=5
dd) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
8. Create an application using Menus
9. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS
Ex no: 10.
7. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

8. Create an application using Menus
9. Write a PL/ SQL program to generate Fibonacci series

Ex no: 11
7. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

8. To Write a PL/SQL Program to display the number in Reverse Order.
9. Create an application using Menus

Ex no: 12
7. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

8. Create an application using Menus
9. To write a PL/SQL program to a function for finding the factorial of given number

Ex no: 13
7. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

8. write a PL/SQL block to apply string functions on a given input string
9. Create an application using Menus

Ex no: 14
7. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

8. Create an application using Menus
9. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 15
7. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

8. Create an application using Menus
9. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
7. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
8. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
9. Create an application using Menus

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending order of
number of employees.
51. Create an application using Menus
3.Write a PL/SQL program to swap two numbers

Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
52. Create an application using Menus
3.Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1.Display the marks of the student number 1 which are equal to the
marks of the student number 2.
53. Create an application using Menus
3.Write a PL/SQL program to find the total and average of 6 subjects and display the grade
Ex no: 20
1.Finding the names of everybody who works in the same department as
a person called James
54. Create an application using Menus


3.Write a PL/SQL program to find the sum of digits in a given numbe
Ex no: 21
1.The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
55. Create an application using Menus
3.Write a PL/SQL program to display the number in reverse order

Ex no: 22
56. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and the
department(consider distinct values). dept_cap contains the capacity for each department. We
need to find those departments(DEPT) where the number of students is less than the total
capacity of the department.
57. Create an application using Menus
-
3.Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from 3 to 7.
Store the radius and the corresponding values of calculated area in an empty table named areas,
consisting of two columns radius & area
Ex no: 23
58. A database is being constructed for storing sales information system. A product can be
described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
59. Create an application using Menus

60. Write a PL/SQL code block that will accept an account number from the user, check if the
users balance is less than minimum balance, only then deduct rs.100/- from the balance. This
process is fired on the acct table

Ex no: 24
1. Write the SQL queries for the following
61. Retrieve the list of names and the cities of all the clients.
62. List the various products available.
63. Find the names of all clients having a as the second letter in their names.
64. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
65. Create an application using Menus

Ex no: 25
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
66. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
67. Create an application using Menus

Ex no: 26
1. Write the SQL queries for the following
5. Rename the column product_rate of Sales_Order_Details tonew_product_rate.
6. List the products in sorted order of their description.
7. Display the order number and date on which the clients placed their order.
68. PL/SQL Program to Display the Fibonacci Series From 1 to 10
69. Create an application using Menus
x no: 27
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000
70. Create an application using Menus

Ex no: 28
1.Write the SQL queries for the following
5. Find the product with description as HDD1034 and DVDRW
6. List the names, city and state of the clients not in the state of ASSAM
7. List of all orders that were cancelled in the of March.
8. Create an application using Menus
3.PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 29
71. Create an application using Menus
72. A student is described by a unique Roll Number, Name Address, and Semester. Each student
enrols himself in an Academic programme offered by a Department. Academic programmes
have programme name(unique), duration, a programme code(unique) and a list of courses
(both core and elective course) while the departments have department code (unique),
department name (unique), HoD who is a Teacher and list of courses offered by it. Each
teacher is described by employee code (unique), name, department and designation. A student
registers some courses in a semester. A course is described by a unique course number, title
of the course, credit allotted for the course and offering department. Database stores the
grades obtained by different student in different courses registered by him/her in different
semesters. Database also stores information about the courses offered by a department
in a semester, the corresponding teacher(s) for each course.
3.PL/SQL Program that Accepts a Number and Find the Factorial
Ex no: 30
73. Create an application using Menus
2.Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3.PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 31
74. Create an application using Menus
2.Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3.PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 32
75. Create an application using Menus
2.Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
3. Retrieve the semester of the student under DBMS subject
3.PL/SQL Program that Accepts a Number and Prints its Binary Format

Ex no: 33
76. Create an application using Menus
2.Write the SQL queries for the following
7. Retrieve all the student names, and arrange into ascending order.
8. Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
9. Find the total credit point of student required to complete for a course like MCA.
3.PL/SQL Program to Calculate the Compound Interest
Ex no: 34
77. Create an application using Menus
2.Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3.PL/SQL Program to Calculate the Sum of 1!+2!++n!
Ex no: 35
78. Create an application using Menus
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
7. List the details of account holders who have a savings account.
8. List the Name and address of account holders with loan amount more than 50,000.
9. Change the name of the customer to ABC whose account number is TU001
3.PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n

Ex no: 36
79. Create an application using Menus
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
7. List the account number with total deposit more than 80,000.
8. List the number of fixed deposit accounts in the bank.
9. Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3.PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!

Ex no: 37
80. Create an application using Menus
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
7. Display the detailed transactions on 28th Aug, 2008.
8. Display the total amount deposited and withdrawn on 29th Aug, 2008.
9. List the details of customers who have a loan.
3.PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 38
81. Create an application using Menus
2.Library information system: Database should store information about books, journals, mgazines
etc. Searching for books can be done by author, title, and subject. Similarly journals canbe searched
by subject area, publisher etc. It should also be possible to see whichbook is issued to which student
and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3.Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 39
82. Create an application using Menus
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 40
83. Create an application using Menus
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3.Write a program to demonstrate %type and %rowtype attributes
Ex no: 41
84. Create an application using Menus
2.Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including results)
prescribed topatients, information if a patient if referred to other expert/hospital. Doctors -
specialization, patients attended etc. Different wards/beds and patients allotted tothem etc. Patient
registration form should include Registration number, Patient name,Address, Gender, Bed number,
date of registration, refer doctor id etc.Doctor information should include Doctor Code, Doctor Name,
and Specializationetc.Lab test information should include Test name, test number, test date, results
andreferred doctors code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3.Write a program to demonstrate predefined exceptions
Ex no: 42
85. Create an application using Menus
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3.Write a program to demonstrate user defined exceptions
Ex no: 43
86. Create an application using Menus
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3.create a procedure which generate all the prime numbers below the given number and count
the no.of prime numbers.
Ex no: 44
1.Table Name: Employee








EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500







87. 0Get all employee details from the employee table
88. Get First_Name,Last_Name from employee table
89. Get First_Name from employee table using alias name Employee Name


2.Develop an application for attendance management system.
3.create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/
90. Create an application using Menus

Ex no: 45
1.Table Name: Employee






EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance






13. Get First_Name from employee table in upper case
14. Get First_Name from employee table in lower case
15. Get unique DEPARTMENT from employee table.
16. Select first 3 characters of FIRST_NAME from EMPLOYEE
17. Create an application using Menus
3.Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.


Ex no: 46
91. Create an application using Menus
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
m) Create the tables with the appropriate integrity constraints
n) Insert around 10 records in each of the tables
o) List all the machine allotments with the student names, lab and machine numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 47
92. Create an application using Menus
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
i) Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
j) How many students class wise have allocated machines in the labs
k) Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
l) Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance
For the above schema, perform the following
p) List the total number of lab allotments day wise
q) Give a count of how many machines have been allocated to the CSIT class
r) Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 48
93. Create an application using Menus
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
e) Create the tables with the appropriate integrity constraints
f) Insert around 10 records in each of the tables
q) List all the bills for the current date with the customer names and item numbers
r) List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 49
94. Create an application using Menus
2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
s) Give a count of how many products have been bought by each customer
t) Give a list of products bought by a customer having cust_id as 5
u) List the item details which are sold as of today
3.Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 50
95. Create an application using Menus
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
v) Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
w) Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department


Part 4:
Ex. No 1:
1.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints

Insert around 10 records in each of the tables

List all the bills for the current date with the customer names and item numbers

2. Write functions/procedures for the following based on the table employee
96. Create an application Using Popup Menus


Ex no: 2
1.2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

List the total Bill details with the quantity sold, price of the item and the final amount

List the details of the customer who have bought a product which has a price>200

Give a count of how many products have been bought by each customer
8. Search for an employee code and return name, designation and deptno.
9. Create an application Using Popup Menus

Ex no: 3
11. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

Give a list of products bought by a customer having cust_id as 5

List the item details which are sold as of today

Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
12. Prepare a salary slip for the given employee code.
13. Create an application Using Popup Menus

Ex no: 4
13. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
oo) Create the tables with the appropriate integrity constraints
pp) Insert around 10 records in each of the tables
qq) List all the student names with their membership numbers

14. Create an application Using Popup Menus
15. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 5
13. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

rr) List all the issues for the current date with student and Book names
ss) List the details of students who borrowed book whose author is CJDATE
tt) Give a count of how many books have been bought by each student

14. Create an application Using Popup Menus
15. Write a PL/SQL program to find the factorial of a number.

Ex no: 6
13. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

uu) Give a list of books taken by student with stud_no as 5
vv) List the book details which are issued as of today
ww) Create a view which lists out the iss_no, iss _date, stud_name, book name
xx) Create a view which lists the daily issues-date wise for the last one week

14. Create an application Using Popup Menus
15. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.

Ex no: 7
13. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
ee) Create the tables with the appropriate integrity constraints
ff) Insert around 10 records in each of the tables
gg) List the employee details department wise

14. Create an application Using Popup Menus
15. Write a PL/SQL program to find the total and average of 4 subjects and display the grade

Ex no: 8
10. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
hh) List all the employee names who joined after particular date
ii) List the details of employees whose basic salary is between 10,000 and 20,000
jj) Give a count of how many employees are working in each department

11. Create an application Using Popup Menus
12. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 9
10. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
kk) Give a names of the employees whose netsalary>10,000
ll) List the details for an employee_id=5
mm) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
11. Create an application Using Popup Menus
12. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS
Ex no: 10.
10. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

11. Create an application Using Popup Menus

12. Write a PL/ SQL program to generate Fibonacci series

Ex no: 11
10. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

11. Create an application Using Popup Menus
12. Create an Application Using DirListbox, DriveListbox , File Listbox controls

Ex no: 12
10. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

11. Create an application Using Popup Menus
12. To write a PL/SQL program to a function for finding the factorial of given number

Ex no: 13
10. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

11. write a PL/SQL block to apply string functions on a given input string
12. Create an application Using Popup Menus

Ex no: 14
10. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

11. Create an application Using Popup Menus
12. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 15
10. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

11. Create an application Using Popup Menus
12. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
10. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
11. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
12. Create an application Using Popup Menus

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending order of
number of employees.
97. Create an application Using Popup Menus
3.Write a PL/SQL program to swap two numbers

Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
98. Create an application Using Popup Menus
3.Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1.Display the marks of the student number 1 which are equal to the
marks of the student number 2.
99. Create a Calculator Application
3.Write a PL/SQL program to find the total and average of 6 subjects and display the grade
Ex no: 20
1.Finding the names of everybody who works in the same department as
a person called James
100. Create an application Using Popup Menus


3.Write a PL/SQL program to find the sum of digits in a given numbe
Ex no: 21
1.The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
101. Create an application Using Popup Menus
3.Write a PL/SQL program to display the number in reverse order

Ex no: 22
102. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and
the department(consider distinct values). dept_cap contains the capacity for each department.
We need to find those departments(DEPT) where the number of students is less than the total
capacity of the department.
103. Create an application Using Popup Menus
-
3.Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from 3 to 7.
Store the radius and the corresponding values of calculated area in an empty table named areas,
consisting of two columns radius & area
Ex no: 23
104. A database is being constructed for storing sales information system. A product can
be described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
105. Create an application Using Popup Menus

106. Write a PL/SQL code block that will accept an account number from the user, check
if the users balance is less than minimum balance, only then deduct rs.100/- from the balance.
This process is fired on the acct table

Ex no: 24
1. Write the SQL queries for the following
107. Retrieve the list of names and the cities of all the clients.
108. List the various products available.
109. Find the names of all clients having a as the second letter in their names.
110. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
111. Create an application Using Popup Menus


Ex no: 25
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
112. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
113. Create an application Using Popup Menus

Ex no: 26
1. Write the SQL queries for the following
8. Rename the column product_rate of Sales_Order_Details tonew_product_rate.
9. List the products in sorted order of their description.
10. Display the order number and date on which the clients placed their order.
114. PL/SQL Program to Display the Fibonacci Series From 1 to 10
115. Create an application Using Popup Menus
Ex no: 27
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000
116. Create an application Using Popup Menus


Ex no: 28
1.Write the SQL queries for the following
9. Find the product with description as HDD1034 and DVDRW
10. List the names, city and state of the clients not in the state of ASSAM
11. List of all orders that were cancelled in the of March.
12. Create an application Using Popup Menus
3.PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 29
117. Create an application Using Popup Menus
118. A student is described by a unique Roll Number, Name Address, and Semester. Each
student enrols himself in an Academic programme offered by a Department. Academic
programmes have programme name(unique), duration, a programme code(unique) and a list
of courses (both core and elective course) while the departments have department code
(unique), department name (unique), HoD who is a Teacher and list of courses offered by it.
Each teacher is described by employee code (unique), name, department and designation. A
student registers some courses in a semester. A course is described by a unique course
number, title of the course, credit allotted for the course and offering department. Database
stores the grades obtained by different student in different courses registered by him/her in
different semesters. Database also stores information about the courses offered by a
department in a semester, the corresponding teacher(s) for each course.
3.PL/SQL Program that Accepts a Number and Find the Factorial
Ex no: 30
119. Create an application Using Popup Menus
2.Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3.PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 31
120. Create an application Using Popup Menus
2.Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3.PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 32
121. Create an application Using Popup Menus
2.Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
3. Retrieve the semester of the student under DBMS subject
3.PL/SQL Program that Accepts a Number and Prints its Binary Format

Ex no: 33
122. Create an application Using Popup Menus
2.Write the SQL queries for the following
10. Retrieve all the student names, and arrange into ascending order.
11. Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
12. Find the total credit point of student required to complete for a course like MCA.
3.PL/SQL Program to Calculate the Compound Interest
Ex no: 34
123. Create an application Using Popup Menus
2.Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3.PL/SQL Program to Calculate the Sum of 1!+2!++n!
Ex no: 35
124. Create an application Using Popup Menus
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
10. List the details of account holders who have a savings account.
11. List the Name and address of account holders with loan amount more than 50,000.
12. Change the name of the customer to ABC whose account number is TU001
3.PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n

Ex no: 36
125. Create an application Using Popup Menus
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
10. List the account number with total deposit more than 80,000.
11. List the number of fixed deposit accounts in the bank.
12. Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3.PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!

Ex no: 37
126. Create an application Using Popup Menus
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
10. Display the detailed transactions on 28th Aug, 2008.
11. Display the total amount deposited and withdrawn on 29th Aug, 2008.
12. List the details of customers who have a loan.
3.PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 38
127. Create an application Using Popup Menus
2.Library information system: Database should store information about books, journals, mgazines
etc. Searching for books can be done by author, title, and subject. Similarly journals canbe searched
by subject area, publisher etc. It should also be possible to see whichbook is issued to which student
and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3.Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 39
128. Create an application Using Popup Menus
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 40
129. Create an application Using Popup Menus
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3.Write a program to demonstrate %type and %rowtype attributes
Ex no: 41
130. Create an application Using Popup Menus
2.Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including results)
prescribed topatients, information if a patient if referred to other expert/hospital. Doctors -
specialization, patients attended etc. Different wards/beds and patients allotted tothem etc. Patient
registration form should include Registration number, Patient name,Address, Gender, Bed number,
date of registration, refer doctor id etc.Doctor information should include Doctor Code, Doctor Name,
and Specializationetc.Lab test information should include Test name, test number, test date, results
andreferred doctors code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3.Write a program to demonstrate predefined exceptions
Ex no: 42
131. Create an application Using Popup Menus
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3.Write a program to demonstrate user defined exceptions
Ex no: 43
132. Create an application Using Popup Menus
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3.create a procedure which generate all the prime numbers below the given number and count
the no.of prime numbers.
Ex no: 44
1.Table Name: Employee








EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500







133. 0Get all employee details from the employee table
134. Get First_Name,Last_Name from employee table
135. Get First_Name from employee table using alias name Employee Name


136. Create an application Using Popup Menus

3.create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/

Ex no: 45
1.Table Name: Employee






EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance






18. Get First_Name from employee table in upper case
19. Get First_Name from employee table in lower case
20. Get unique DEPARTMENT from employee table.
21. Select first 3 characters of FIRST_NAME from EMPLOYEE








137. Create an application Using Popup Menus
3.Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.

Ex no: 46
138. Create an application Using Popup Menus
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
s) Create the tables with the appropriate integrity constraints
t) Insert around 10 records in each of the tables
u) List all the machine allotments with the student names, lab and machine numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 47
139. Create an application Using Popup Menus
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
m) Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
n) How many students class wise have allocated machines in the labs
o) Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance
p) Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
v) List the total number of lab allotments day wise
w) Give a count of how many machines have been allocated to the CSIT class
x) Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 48
140. Create an application Using Popup Menus

2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
g) Create the tables with the appropriate integrity constraints
h) Insert around 10 records in each of the tables
x) List all the bills for the current date with the customer names and item numbers
y) List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 49
141. Create an application Using Popup Menus
2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
z) Give a count of how many products have been bought by each customer
aa) Give a list of products bought by a customer having cust_id as 5
bb) List the item details which are sold as of today
3.Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 50
142. Create an application Using Popup Menus
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
cc) Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
dd) Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department


Ex. No 1:
1.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints

Insert around 10 records in each of the tables

List all the bills for the current date with the customer names and item numbers

2. Write functions/procedures for the following based on the table employee
143. Create an application Using Shape and Timer controls


Ex no: 2
1.2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

List the total Bill details with the quantity sold, price of the item and the final amount

List the details of the customer who have bought a product which has a price>200

Give a count of how many products have been bought by each customer
10. Search for an employee code and return name, designation and deptno.
11. Create an application Using Shape and Timer controls

Ex no: 3
14. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

Give a list of products bought by a customer having cust_id as 5

List the item details which are sold as of today

Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
15. Prepare a salary slip for the given employee code.
16. Create an application Using Shape and Timer controls

Ex no: 4
16. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
yy) Create the tables with the appropriate integrity constraints
zz) Insert around 10 records in each of the tables
aaa) List all the student names with their membership numbers

17. Create an application Using Shape and Timer controls
18. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 5
16. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

bbb) List all the issues for the current date with student and Book names
ccc) List the details of students who borrowed book whose author is CJDATE
ddd) Give a count of how many books have been bought by each student

17. Create an application Using Shape and Timer controls
18. Write a PL/SQL program to find the factorial of a number.

Ex no: 6
16. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

eee) Give a list of books taken by student with stud_no as 5
fff) List the book details which are issued as of today
ggg) Create a view which lists out the iss_no, iss _date, stud_name, book name
hhh) Create a view which lists the daily issues-date wise for the last one week

17. Create an application Using Shape and Timer controls
18. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.

Ex no: 7
16. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
nn) Create the tables with the appropriate integrity constraints
oo) Insert around 10 records in each of the tables
pp) List the employee details department wise

17. Create an application Using Shape and Timer controls
18. Write a PL/SQL program to find the total and average of 4 subjects and display the grade

Ex no: 8
13. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
qq) List all the employee names who joined after particular date
rr) List the details of employees whose basic salary is between 10,000 and 20,000
ss) Give a count of how many employees are working in each department

14. Create an application Using Shape and Timer controls
15. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 9
13. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
tt) Give a names of the employees whose netsalary>10,000
uu) List the details for an employee_id=5
vv) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
14. Create an application Using Shape and Timer controls
15. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS
Ex no: 10.
13. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

14. Create an application Using Shape and Timer controls

15. Write a PL/ SQL program to generate Fibonacci series

Ex no: 11
13. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

14. Create an application Using Shape and Timer controls
15. Create an Application Using DirListbox, DriveListbox , File Listbox controls

Ex no: 12
13. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

14. Create an application Using Shape and Timer controls
15. To write a PL/SQL program to a function for finding the factorial of given number

Ex no: 13
13. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

14. write a PL/SQL block to apply string functions on a given input string
15. Create an application Using Shape and Timer controls

Ex no: 14
13. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

14. Create an application Using Shape and Timer controls
15. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 15
13. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

14. Create an application Using Shape and Timer controls
15. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
13. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
14. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
15. Create an application Using Shape and Timer controls

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending order of
number of employees.
144. Create an application Using Shape and Timer controls
3.Write a PL/SQL program to swap two numbers

Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
145. Create an application Using Shape and Timer controls
3.Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1.Display the marks of the student number 1 which are equal to the
marks of the student number 2.
146. Create a Calculator Application
3.Write a PL/SQL program to find the total and average of 6 subjects and display the grade
Ex no: 20
1.Finding the names of everybody who works in the same department as
a person called James
147. Create an application Using Shape and Timer controls


3.Write a PL/SQL program to find the sum of digits in a given numbe
Ex no: 21
1.The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
148. Create an application Using Shape and Timer controls
3.Write a PL/SQL program to display the number in reverse order

Ex no: 8
16. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
ww) List all the employee names who joined after particular date
xx) List the details of employees whose basic salary is between 10,000 and 20,000
yy) Give a count of how many employees are working in each department

17. Explain the use of options in Property Window in VB
18. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 9
16. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
zz) Give a names of the employees whose netsalary>10,000
aaa) List the details for an employee_id=5
bbb) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
17. Explain the use of options in Property Window in VB
18. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS
Ex no: 10.
16. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

17. Explain the use of options in Property Window in VB

18. Write a PL/ SQL program to generate Fibonacci series

Ex no: 11
16. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

17. Explain the use of options in Property Window in VB
18. Create an Application Using DirListbox, DriveListbox , File Listbox controls

Ex no: 12
16. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

17. Explain the use of options in Property Window in VB
18. To write a PL/SQL program to a function for finding the factorial of given number

Ex no: 13
16. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

17. write a PL/SQL block to apply string functions on a given input string
18. Explain the use of options in Property Window in VB

Ex no: 14
16. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

17. Explain the use of options in Property Window in VB
18. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 15
16. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

17. Explain the use of options in Property Window in VB
18. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
16. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
17. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
18. Explain the use of options in Property Window in VB

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending order of
number of employees.
149. Explain the use of options in Property Window in VB
3.Write a PL/SQL program to swap two numbers

Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
150. Explain the use of options in Property Window in VB
3.Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1.Display the marks of the student number 1 which are equal to the
marks of the student number 2.
151. Create a Calculator Application
3.Write a PL/SQL program to find the total and average of 6 subjects and display the grade
Ex no: 20
1.Finding the names of everybody who works in the same department as
a person called James
152. Explain the use of options in Property Window in VB


3.Write a PL/SQL program to find the sum of digits in a given numbe
Ex no: 21
1.The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
153. Explain the use of options in Property Window in VB
3.Write a PL/SQL program to display the number in reverse order

Ex no: 22
154. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and
the department(consider distinct values). dept_cap contains the capacity for each department.
We need to find those departments(DEPT) where the number of students is less than the total
capacity of the department.
155. Explain the use of options in Property Window in VB
-
3.Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from 3 to 7.
Store the radius and the corresponding values of calculated area in an empty table named areas,
consisting of two columns radius & area
Ex no: 23
156. A database is being constructed for storing sales information system. A product can
be described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
157. Explain the use of options in Property Window in VB

158. Write a PL/SQL code block that will accept an account number from the user, check
if the users balance is less than minimum balance, only then deduct rs.100/- from the balance.
This process is fired on the acct table

Ex no: 24
1. Write the SQL queries for the following
159. Retrieve the list of names and the cities of all the clients.
160. List the various products available.
161. Find the names of all clients having a as the second letter in their names.
162. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
163. Explain the use of options in Property Window in VB


Ex no: 25
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
164. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
165. Explain the use of options in Property Window in VB

Ex no: 26
1. Write the SQL queries for the following
11. Rename the column product_rate of Sales_Order_Details tonew_product_rate.
12. List the products in sorted order of their description.
13. Display the order number and date on which the clients placed their order.
166. PL/SQL Program to Display the Fibonacci Series From 1 to 10
167. Explain the use of options in Property Window in VB
Ex no: 27
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000
168. Explain the use of options in Property Window in VB


Ex no: 28
1.Write the SQL queries for the following
13. Find the product with description as HDD1034 and DVDRW
14. List the names, city and state of the clients not in the state of ASSAM
15. List of all orders that were cancelled in the of March.
16. Explain the use of options in Property Window in VB
3.PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 29
169. Explain the use of options in Property Window in VB
170. A student is described by a unique Roll Number, Name Address, and Semester. Each
student enrols himself in an Academic programme offered by a Department. Academic
programmes have programme name(unique), duration, a programme code(unique) and a list
of courses (both core and elective course) while the departments have department code
(unique), department name (unique), HoD who is a Teacher and list of courses offered by it.
Each teacher is described by employee code (unique), name, department and designation. A
student registers some courses in a semester. A course is described by a unique course
number, title of the course, credit allotted for the course and offering department. Database
stores the grades obtained by different student in different courses registered by him/her in
different semesters. Database also stores information about the courses offered by a
department in a semester, the corresponding teacher(s) for each course.
3.PL/SQL Program that Accepts a Number and Find the Factorial
Ex no: 30
171. Explain the use of options in Property Window in VB
2.Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3.PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 31
172. Explain the use of options in Property Window in VB
2.Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3.PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 32
173. Explain the use of options in Property Window in VB
2.Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
3. Retrieve the semester of the student under DBMS subject
3.PL/SQL Program that Accepts a Number and Prints its Binary Format

Ex no: 33
174. Explain the use of options in Property Window in VB
2.Write the SQL queries for the following
13. Retrieve all the student names, and arrange into ascending order.
14. Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
15. Find the total credit point of student required to complete for a course like MCA.
3.PL/SQL Program to Calculate the Compound Interest
Ex no: 34
175. Explain the use of options in Property Window in VB
2.Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3.PL/SQL Program to Calculate the Sum of 1!+2!++n!
Ex no: 35
176. Explain the use of options in Property Window in VB
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
13. List the details of account holders who have a savings account.
14. List the Name and address of account holders with loan amount more than 50,000.
15. Change the name of the customer to ABC whose account number is TU001
3.PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n

Ex no: 36
177. Explain the use of options in Property Window in VB
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
13. List the account number with total deposit more than 80,000.
14. List the number of fixed deposit accounts in the bank.
15. Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3.PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!

Ex no: 37
178. Explain the use of options in Property Window in VB
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
13. Display the detailed transactions on 28th Aug, 2008.
14. Display the total amount deposited and withdrawn on 29th Aug, 2008.
15. List the details of customers who have a loan.
3.PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 38
179. Explain the use of options in Property Window in VB
2.Library information system: Database should store information about books, journals, mgazines
etc. Searching for books can be done by author, title, and subject. Similarly journals canbe searched
by subject area, publisher etc. It should also be possible to see whichbook is issued to which student
and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3.Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 39
180. Explain the use of options in Property Window in VB
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 40
181. Explain the use of options in Property Window in VB
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3.Write a program to demonstrate %type and %rowtype attributes
Ex no: 41
182. Explain the use of options in Property Window in VB
2.Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including results)
prescribed topatients, information if a patient if referred to other expert/hospital. Doctors -
specialization, patients attended etc. Different wards/beds and patients allotted tothem etc. Patient
registration form should include Registration number, Patient name,Address, Gender, Bed number,
date of registration, refer doctor id etc.Doctor information should include Doctor Code, Doctor Name,
and Specializationetc.Lab test information should include Test name, test number, test date, results
andreferred doctors code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3.Write a program to demonstrate predefined exceptions
Ex no: 42
183. Explain the use of options in Property Window in VB
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3.Write a program to demonstrate user defined exceptions
Ex no: 43
184. Explain the use of options in Property Window in VB
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3.create a procedure which generate all the prime numbers below the given number and count
the no.of prime numbers.
Ex no: 44
1.Table Name: Employee















185. 0Get all employee details from the employee table
186. Get First_Name,Last_Name from employee table
187. Get First_Name from employee table using alias name Employee Name
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance


188. Explain the use of options in Property Window in VB

3.create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/

Ex no: 45
1.Table Name: Employee












22. Get
First_Name
from
employee
table in
upper case
23. G
et
First_Name
from
employee table in lower case
24. Get unique DEPARTMENT from employee table.
25. Select first 3 characters of FIRST_NAME from EMPLOYEE








189. Explain the use of options in Property Window in VB
3.Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.

Ex no: 46
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance
190. Explain the use of options in Property Window in VB
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
y) Create the tables with the appropriate integrity constraints
z) Insert around 10 records in each of the tables
aa) List all the machine allotments with the student names, lab and machine numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 47
191. Explain the use of options in Property Window in VB
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
q) Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
r) How many students class wise have allocated machines in the labs
s) Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
t) Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
bb) List the total number of lab allotments day wise
cc) Give a count of how many machines have been allocated to the CSIT class
dd) Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 48
192. Explain the use of options in Property Window in VB

2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
i) Create the tables with the appropriate integrity constraints
j) Insert around 10 records in each of the tables
ee) List all the bills for the current date with the customer names and item numbers
ff) List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 49
193. Explain the use of options in Property Window in VB
2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
gg) Give a count of how many products have been bought by each customer
hh) Give a list of products bought by a customer having cust_id as 5
ii) List the item details which are sold as of today
3.Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 50
194. Explain the use of options in Property Window in VB
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
jj) Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
kk) Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department

Part 5


Ex. No 1:
1.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints

Insert around 10 records in each of the tables

List all the bills for the current date with the customer names and item numbers

2. Write functions/procedures for the following based on the table employee
195. Write program using if clause or else if clause.


Ex no: 2
1.2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

List the total Bill details with the quantity sold, price of the item and the final amount

List the details of the customer who have bought a product which has a price>200

Give a count of how many products have been bought by each customer
12. Search for an employee code and return name, designation and deptno.
13. Write program using if clause or else if clause.

Ex no: 3
17. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

Give a list of products bought by a customer having cust_id as 5

List the item details which are sold as of today

Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
18. Prepare a salary slip for the given employee code.
19. Write program using if clause or else if clause.

Ex no: 4
19. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
iii) Create the tables with the appropriate integrity constraints
jjj) Insert around 10 records in each of the tables
kkk) List all the student names with their membership numbers

20. Write program using if clause or else if clause.
21. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 5
19. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

lll) List all the issues for the current date with student and Book names
mmm) List the details of students who borrowed book whose author is CJDATE
nnn) Give a count of how many books have been bought by each student

20. Write program using if clause or else if clause.
21. Write a PL/SQL program to find the factorial of a number.

Ex no: 6
19. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

ooo) Give a list of books taken by student with stud_no as 5
ppp) List the book details which are issued as of today
qqq) Create a view which lists out the iss_no, iss _date, stud_name, book name
rrr) Create a view which lists the daily issues-date wise for the last one week

20. Write program using if clause or else if clause.
21. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.

Ex no: 7
19. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
ccc) Create the tables with the appropriate integrity constraints
ddd) Insert around 10 records in each of the tables
eee) List the employee details department wise

20. Write program using if clause or else if clause.
21. Write a PL/SQL program to find the total and average of 4 subjects and display the grade

Ex no: 8
19. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
fff) List all the employee names who joined after particular date
ggg) List the details of employees whose basic salary is between 10,000 and 20,000
hhh) Give a count of how many employees are working in each department

20. Write program using if clause or else if clause.
21. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 9
19. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
iii) Give a names of the employees whose netsalary>10,000
jjj) List the details for an employee_id=5
kkk) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
20. Write program using if clause or else if clause.
21. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS
Ex no: 10.
19. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

20. Write program using if clause or else if clause.

21. Write a PL/ SQL program to generate Fibonacci series

Ex no: 11
19. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

20. Write program using if clause or else if clause.
21. Create an Application Using DirListbox, DriveListbox , File Listbox controls

Ex no: 12
19. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

20. Write program using if clause or else if clause.
21. To write a PL/SQL program to a function for finding the factorial of given number

Ex no: 13
19. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

20. write a PL/SQL block to apply string functions on a given input string
21. Write program using if clause or else if clause.

Ex no: 14
19. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

20. Write program using if clause or else if clause.
21. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 15
19. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

20. Write program using if clause or else if clause.
21. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
19. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
20. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
21. Write program using if clause or else if clause.

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending order of
number of employees.
196. Write program using if clause or else if clause.
3.Write a PL/SQL program to swap two numbers

Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
197. Write program using if clause or else if clause.
3.Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1.Display the marks of the student number 1 which are equal to the
marks of the student number 2.
198. Create a Calculator Application
3.Write a PL/SQL program to find the total and average of 6 subjects and display the grade
Ex no: 20
1.Finding the names of everybody who works in the same department as
a person called James
199. Write program using if clause or else if clause.


3.Write a PL/SQL program to find the sum of digits in a given numbe
Ex no: 21
1.The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
200. Write program using if clause or else if clause.
3.Write a PL/SQL program to display the number in reverse order

Ex no: 22
201. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and
the department(consider distinct values). dept_cap contains the capacity for each department.
We need to find those departments(DEPT) where the number of students is less than the total
capacity of the department.
202. Write program using if clause or else if clause.
-
3.Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from 3 to 7.
Store the radius and the corresponding values of calculated area in an empty table named areas,
consisting of two columns radius & area
Ex no: 23
203. A database is being constructed for storing sales information system. A product can
be described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
204. Write program using if clause or else if clause.

205. Write a PL/SQL code block that will accept an account number from the user, check
if the users balance is less than minimum balance, only then deduct rs.100/- from the balance.
This process is fired on the acct table

Ex no: 24
1. Write the SQL queries for the following
206. Retrieve the list of names and the cities of all the clients.
207. List the various products available.
208. Find the names of all clients having a as the second letter in their names.
209. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
210. Write program using if clause or else if clause.


Ex no: 25
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
211. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
212. Write program using if clause or else if clause.

Ex no: 26
1. Write the SQL queries for the following
14. Rename the column product_rate of Sales_Order_Details tonew_product_rate.
15. List the products in sorted order of their description.
16. Display the order number and date on which the clients placed their order.
213. PL/SQL Program to Display the Fibonacci Series From 1 to 10
214. Write program using if clause or else if clause.
Ex no: 27
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000
215. Write program using if clause or else if clause.


Ex no: 28
1.Write the SQL queries for the following
17. Find the product with description as HDD1034 and DVDRW
18. List the names, city and state of the clients not in the state of ASSAM
19. List of all orders that were cancelled in the of March.
20. Write program using if clause or else if clause.
3.PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 29
216. Write program using if clause or else if clause.
217. A student is described by a unique Roll Number, Name Address, and Semester. Each
student enrols himself in an Academic programme offered by a Department. Academic
programmes have programme name(unique), duration, a programme code(unique) and a list
of courses (both core and elective course) while the departments have department code
(unique), department name (unique), HoD who is a Teacher and list of courses offered by it.
Each teacher is described by employee code (unique), name, department and designation. A
student registers some courses in a semester. A course is described by a unique course
number, title of the course, credit allotted for the course and offering department. Database
stores the grades obtained by different student in different courses registered by him/her in
different semesters. Database also stores information about the courses offered by a
department in a semester, the corresponding teacher(s) for each course.
3.PL/SQL Program that Accepts a Number and Find the Factorial
Ex no: 30
218. Write program using if clause or else if clause.
2.Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3.PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 31
219. Write program using if clause or else if clause.
2.Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3.PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 32
220. Write program using if clause or else if clause.
2.Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
3. Retrieve the semester of the student under DBMS subject
3.PL/SQL Program that Accepts a Number and Prints its Binary Format

Ex no: 33
221. Write program using if clause or else if clause.
2.Write the SQL queries for the following
16. Retrieve all the student names, and arrange into ascending order.
17. Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
18. Find the total credit point of student required to complete for a course like MCA.
3.PL/SQL Program to Calculate the Compound Interest
Ex no: 34
222. Write program using if clause or else if clause.
2.Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3.PL/SQL Program to Calculate the Sum of 1!+2!++n!
Ex no: 35
223. Write program using if clause or else if clause.
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
16. List the details of account holders who have a savings account.
17. List the Name and address of account holders with loan amount more than 50,000.
18. Change the name of the customer to ABC whose account number is TU001
3.PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n

Ex no: 36
224. Write program using if clause or else if clause.
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
16. List the account number with total deposit more than 80,000.
17. List the number of fixed deposit accounts in the bank.
18. Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3.PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!

Ex no: 37
225. Write program using if clause or else if clause.
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
16. Display the detailed transactions on 28th Aug, 2008.
17. Display the total amount deposited and withdrawn on 29th Aug, 2008.
18. List the details of customers who have a loan.
3.PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 38
226. Write program using if clause or else if clause.
2.Library information system: Database should store information about books, journals, mgazines
etc. Searching for books can be done by author, title, and subject. Similarly journals canbe searched
by subject area, publisher etc. It should also be possible to see whichbook is issued to which student
and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3.Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 39
227. Write program using if clause or else if clause.
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 40
228. Write program using if clause or else if clause.
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3.Write a program to demonstrate %type and %rowtype attributes
Ex no: 41
229. Write program using if clause or else if clause.
2.Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including results)
prescribed topatients, information if a patient if referred to other expert/hospital. Doctors -
specialization, patients attended etc. Different wards/beds and patients allotted tothem etc. Patient
registration form should include Registration number, Patient name,Address, Gender, Bed number,
date of registration, refer doctor id etc.Doctor information should include Doctor Code, Doctor Name,
and Specializationetc.Lab test information should include Test name, test number, test date, results
andreferred doctors code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3.Write a program to demonstrate predefined exceptions
Ex no: 42
230. Write program using if clause or else if clause.
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3.Write a program to demonstrate user defined exceptions
Ex no: 43
231. Write program using if clause or else if clause.
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3.create a procedure which generate all the prime numbers below the given number and count
the no.of prime numbers.
Ex no: 44
1.Table Name: Employee















232. 0Get all employee details from the employee table
233. Get First_Name,Last_Name from employee table
234. Get First_Name from employee table using alias name Employee Name

EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance

235. Write program using if clause or else if clause.

3.create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/

Ex no: 45
1.Table Name: Employee












26. Get
First_Name
from
employee
table in
upper case
27. G
et
First_Name
from
employee
table in lower case
28. Get unique DEPARTMENT from employee table.
29. Select first 3 characters of FIRST_NAME from EMPLOYEE








236. Write program using if clause or else if clause.
3.Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.

Ex no: 46
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance
237. Write program using if clause or else if clause.
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
ee) Create the tables with the appropriate integrity constraints
ff) Insert around 10 records in each of the tables
gg) List all the machine allotments with the student names, lab and machine numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 47
238. Write program using if clause or else if clause.
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
u) Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
v) How many students class wise have allocated machines in the labs
w) Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
x) Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
hh) List the total number of lab allotments day wise
ii) Give a count of how many machines have been allocated to the CSIT class
jj) Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 48
239. Write program using if clause or else if clause.

2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
k) Create the tables with the appropriate integrity constraints
l) Insert around 10 records in each of the tables
ll) List all the bills for the current date with the customer names and item numbers
mm) List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 49
240. Write program using if clause or else if clause.
2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
nn) Give a count of how many products have been bought by each customer
oo) Give a list of products bought by a customer having cust_id as 5
pp) List the item details which are sold as of today
3.Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 50
241. Write program using if clause or else if clause.
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
qq) Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
rr) Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department

Part 6:


Ex. No 1:
1.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints

Insert around 10 records in each of the tables

List all the bills for the current date with the customer names and item numbers

2. Write functions/procedures for the following based on the table employee
242. Writing a program using Select Case.


Ex no: 2
1.2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

List the total Bill details with the quantity sold, price of the item and the final amount

List the details of the customer who have bought a product which has a price>200

Give a count of how many products have been bought by each customer
14. Search for an employee code and return name, designation and deptno.
15. Writing a program using Select Case.

Ex no: 3
20. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

Give a list of products bought by a customer having cust_id as 5

List the item details which are sold as of today

Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
21. Prepare a salary slip for the given employee code.
22. Writing a program using Select Case.

Ex no: 4
22. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
sss) Create the tables with the appropriate integrity constraints
ttt) Insert around 10 records in each of the tables
uuu) List all the student names with their membership numbers

23. Writing a program using Select Case.
24. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 5
22. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

vvv) List all the issues for the current date with student and Book names
www) List the details of students who borrowed book whose author is CJDATE
xxx) Give a count of how many books have been bought by each student

23. Writing a program using Select Case.
24. Write a PL/SQL program to find the factorial of a number.

Ex no: 6
22. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

yyy) Give a list of books taken by student with stud_no as 5
zzz) List the book details which are issued as of today
aaaa) Create a view which lists out the iss_no, iss _date, stud_name, book name
bbbb) Create a view which lists the daily issues-date wise for the last one week

23. Writing a program using Select Case.
24. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.

Ex no: 7
22. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
lll) Create the tables with the appropriate integrity constraints
mmm) Insert around 10 records in each of the tables
nnn) List the employee details department wise

23. Writing a program using Select Case.
24. Write a PL/SQL program to find the total and average of 4 subjects and display the grade

Ex no: 8
22. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
ooo) List all the employee names who joined after particular date
ppp) List the details of employees whose basic salary is between 10,000 and 20,000
qqq) Give a count of how many employees are working in each department

23. Writing a program using Select Case.
24. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 9
22. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
rrr) Give a names of the employees whose netsalary>10,000
sss) List the details for an employee_id=5
ttt) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
23. Writing a program using Select Case.
24. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS
Ex no: 10.
22. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

23. Writing a program using Select Case.

24. Write a PL/ SQL program to generate Fibonacci series

Ex no: 11
22. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

23. Writing a program using Select Case.
24. Create an Application Using DirListbox, DriveListbox , File Listbox controls

Ex no: 12
22. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

23. Writing a program using Select Case.
24. To write a PL/SQL program to a function for finding the factorial of given number

Ex no: 13
22. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

23. write a PL/SQL block to apply string functions on a given input string
24. Writing a program using Select Case.

Ex no: 14
22. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

23. Writing a program using Select Case.
24. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 15
22. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

23. Writing a program using Select Case.
24. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
22. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
23. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
24. Writing a program using Select Case.

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending order of
number of employees.
243. Writing a program using Select Case.
3.Write a PL/SQL program to swap two numbers

Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
244. Writing a program using Select Case.
3.Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1.Display the marks of the student number 1 which are equal to the
marks of the student number 2.
245. Create a Calculator Application
3.Write a PL/SQL program to find the total and average of 6 subjects and display the grade
Ex no: 20
1.Finding the names of everybody who works in the same department as
a person called James
246. Writing a program using Select Case.


3.Write a PL/SQL program to find the sum of digits in a given numbe
Ex no: 21
1.The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
247. Writing a program using Select Case.
3.Write a PL/SQL program to display the number in reverse order

Ex no: 22
248. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and
the department(consider distinct values). dept_cap contains the capacity for each department.
We need to find those departments(DEPT) where the number of students is less than the total
capacity of the department.
249. Writing a program using Select Case.
-
3.Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from 3 to 7.
Store the radius and the corresponding values of calculated area in an empty table named areas,
consisting of two columns radius & area
Ex no: 23
250. A database is being constructed for storing sales information system. A product can
be described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
251. Writing a program using Select Case.

252. Write a PL/SQL code block that will accept an account number from the user, check
if the users balance is less than minimum balance, only then deduct rs.100/- from the balance.
This process is fired on the acct table

Ex no: 24
1. Write the SQL queries for the following
253. Retrieve the list of names and the cities of all the clients.
254. List the various products available.
255. Find the names of all clients having a as the second letter in their names.
256. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
257. Writing a program using Select Case.


Ex no: 25
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
258. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
259. Writing a program using Select Case.

Ex no: 26
1. Write the SQL queries for the following
17. Rename the column product_rate of Sales_Order_Details tonew_product_rate.
18. List the products in sorted order of their description.
19. Display the order number and date on which the clients placed their order.
260. PL/SQL Program to Display the Fibonacci Series From 1 to 10
261. Writing a program using Select Case.
Ex no: 27
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000
262. Writing a program using Select Case.


Ex no: 28
1.Write the SQL queries for the following
21. Find the product with description as HDD1034 and DVDRW
22. List the names, city and state of the clients not in the state of ASSAM
23. List of all orders that were cancelled in the of March.
24. Writing a program using Select Case.
3.PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 29
263. Writing a program using Select Case.
264. A student is described by a unique Roll Number, Name Address, and Semester. Each
student enrols himself in an Academic programme offered by a Department. Academic
programmes have programme name(unique), duration, a programme code(unique) and a list
of courses (both core and elective course) while the departments have department code
(unique), department name (unique), HoD who is a Teacher and list of courses offered by it.
Each teacher is described by employee code (unique), name, department and designation. A
student registers some courses in a semester. A course is described by a unique course
number, title of the course, credit allotted for the course and offering department. Database
stores the grades obtained by different student in different courses registered by him/her in
different semesters. Database also stores information about the courses offered by a
department in a semester, the corresponding teacher(s) for each course.
3.PL/SQL Program that Accepts a Number and Find the Factorial
Ex no: 30
265. Writing a program using Select Case.
2.Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3.PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 31
266. Writing a program using Select Case.
2.Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3.PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 32
267. Writing a program using Select Case.
2.Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
3. Retrieve the semester of the student under DBMS subject
3.PL/SQL Program that Accepts a Number and Prints its Binary Format

Ex no: 33
268. Writing a program using Select Case.
2.Write the SQL queries for the following
19. Retrieve all the student names, and arrange into ascending order.
20. Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
21. Find the total credit point of student required to complete for a course like MCA.
3.PL/SQL Program to Calculate the Compound Interest
Ex no: 34
269. Writing a program using Select Case.
2.Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3.PL/SQL Program to Calculate the Sum of 1!+2!++n!
Ex no: 35
270. Writing a program using Select Case.
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
19. List the details of account holders who have a savings account.
20. List the Name and address of account holders with loan amount more than 50,000.
21. Change the name of the customer to ABC whose account number is TU001
3.PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n

Ex no: 36
271. Writing a program using Select Case.
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
19. List the account number with total deposit more than 80,000.
20. List the number of fixed deposit accounts in the bank.
21. Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3.PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!

Ex no: 37
272. Writing a program using Select Case.
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
19. Display the detailed transactions on 28th Aug, 2008.
20. Display the total amount deposited and withdrawn on 29th Aug, 2008.
21. List the details of customers who have a loan.
3.PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 38
273. Writing a program using Select Case.
2.Library information system: Database should store information about books, journals, mgazines
etc. Searching for books can be done by author, title, and subject. Similarly journals canbe searched
by subject area, publisher etc. It should also be possible to see whichbook is issued to which student
and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3.Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 39
274. Writing a program using Select Case.
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 40
275. Writing a program using Select Case.
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3.Write a program to demonstrate %type and %rowtype attributes
Ex no: 41
276. Writing a program using Select Case.
2.Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including results)
prescribed topatients, information if a patient if referred to other expert/hospital. Doctors -
specialization, patients attended etc. Different wards/beds and patients allotted tothem etc. Patient
registration form should include Registration number, Patient name,Address, Gender, Bed number,
date of registration, refer doctor id etc.Doctor information should include Doctor Code, Doctor Name,
and Specializationetc.Lab test information should include Test name, test number, test date, results
andreferred doctors code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3.Write a program to demonstrate predefined exceptions
Ex no: 42
277. Writing a program using Select Case.
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3.Write a program to demonstrate user defined exceptions
Ex no: 43
278. Writing a program using Select Case.
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3.create a procedure which generate all the prime numbers below the given number and count
the no.of prime numbers.
Ex no: 44
1.Table Name: Employee















279. 0Get all employee details from the employee table
280. Get First_Name,Last_Name from employee table
281. Get First_Name from employee table using alias name Employee Name

EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance

282. Writing a program using Select Case.

3.create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/

Ex no: 45
1.Table Name: Employee












30. Get
First_Name
from
employee
table in
upper case
31. G
et
First_Name
from
employee
table in lower case
32. Get unique DEPARTMENT from employee table.
33. Select first 3 characters of FIRST_NAME from EMPLOYEE








283. Writing a program using Select Case.
3.Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.

Ex no: 46
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance
284. Writing a program using Select Case.
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
kk) Create the tables with the appropriate integrity constraints
ll) Insert around 10 records in each of the tables
mm) List all the machine allotments with the student names, lab and machine numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 47
285. Writing a program using Select Case.
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
y) Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
z) How many students class wise have allocated machines in the labs
aa) Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
bb) Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
nn) List the total number of lab allotments day wise
oo) Give a count of how many machines have been allocated to the CSIT class
pp) Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 48
286. Writing a program using Select Case.

2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
m) Create the tables with the appropriate integrity constraints
n) Insert around 10 records in each of the tables
ss) List all the bills for the current date with the customer names and item numbers
tt) List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 49
287. Writing a program using Select Case.
2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
uu) Give a count of how many products have been bought by each customer
vv) Give a list of products bought by a customer having cust_id as 5
ww) List the item details which are sold as of today
3.Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 50
288. Writing a program using Select Case.
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
xx) Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
yy) Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department

Part 7


Ex. No 1:
1.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints

Insert around 10 records in each of the tables

List all the bills for the current date with the customer names and item numbers

2. Write functions/procedures for the following based on the table employee
289. Write a program using List boxes and combo boxes


Ex no: 2
1.2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

List the total Bill details with the quantity sold, price of the item and the final amount

List the details of the customer who have bought a product which has a price>200

Give a count of how many products have been bought by each customer
16. Search for an employee code and return name, designation and deptno.
17. Write a program using List boxes and combo boxes

Ex no: 3
23. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

Give a list of products bought by a customer having cust_id as 5

List the item details which are sold as of today

Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
24. Prepare a salary slip for the given employee code.
25. Write a program using List boxes and combo boxes

Ex no: 4
25. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
cccc) Create the tables with the appropriate integrity constraints
dddd) Insert around 10 records in each of the tables
eeee) List all the student names with their membership numbers

26. Write a program using List boxes and combo boxes
27. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 5
25. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

ffff) List all the issues for the current date with student and Book names
gggg) List the details of students who borrowed book whose author is CJDATE
hhhh) Give a count of how many books have been bought by each student

26. Write a program using List boxes and combo boxes
27. Write a PL/SQL program to find the factorial of a number.

Ex no: 6
25. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

iiii) Give a list of books taken by student with stud_no as 5
jjjj) List the book details which are issued as of today
kkkk) Create a view which lists out the iss_no, iss _date, stud_name, book name
llll) Create a view which lists the daily issues-date wise for the last one week

26. Write a program using List boxes and combo boxes
27. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.

Ex no: 7
25. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
uuu) Create the tables with the appropriate integrity constraints
vvv) Insert around 10 records in each of the tables
www) List the employee details department wise

26. Write a program using List boxes and combo boxes
27. Write a PL/SQL program to find the total and average of 4 subjects and display the grade

Ex no: 8
25. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
xxx) List all the employee names who joined after particular date
yyy) List the details of employees whose basic salary is between 10,000 and 20,000
zzz) Give a count of how many employees are working in each department

26. Write a program using List boxes and combo boxes
27. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 9
25. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
aaaa) Give a names of the employees whose netsalary>10,000
bbbb) List the details for an employee_id=5
cccc) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
26. Write a program using List boxes and combo boxes
27. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS
Ex no: 10.
25. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

26. Write a program using List boxes and combo boxes

27. Write a PL/ SQL program to generate Fibonacci series

Ex no: 11
25. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

26. Write a program using List boxes and combo boxes
27. Create an Application Using DirListbox, DriveListbox , File Listbox controls

Ex no: 12
25. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

26. Write a program using List boxes and combo boxes
27. To write a PL/SQL program to a function for finding the factorial of given number

Ex no: 13
25. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

26. write a PL/SQL block to apply string functions on a given input string
27. Write a program using List boxes and combo boxes

Ex no: 14
25. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

26. Write a program using List boxes and combo boxes
27. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 15
25. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

26. Write a program using List boxes and combo boxes
27. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
25. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
26. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
27. Write a program using List boxes and combo boxes

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending order of
number of employees.
290. Write a program using List boxes and combo boxes
3.Write a PL/SQL program to swap two numbers

Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
291. Write a program using List boxes and combo boxes
3.Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1.Display the marks of the student number 1 which are equal to the
marks of the student number 2.
292. Create a Calculator Application
3.Write a PL/SQL program to find the total and average of 6 subjects and display the grade
Ex no: 20
1.Finding the names of everybody who works in the same department as
a person called James
293. Write a program using List boxes and combo boxes


3.Write a PL/SQL program to find the sum of digits in a given numbe
Ex no: 21
1.The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
294. Write a program using List boxes and combo boxes
3.Write a PL/SQL program to display the number in reverse order

Ex no: 22
295. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and
the department(consider distinct values). dept_cap contains the capacity for each department.
We need to find those departments(DEPT) where the number of students is less than the total
capacity of the department.
296. Write a program using List boxes and combo boxes
-
3.Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from 3 to 7.
Store the radius and the corresponding values of calculated area in an empty table named areas,
consisting of two columns radius & area
Ex no: 23
297. A database is being constructed for storing sales information system. A product can
be described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
298. Write a program using List boxes and combo boxes

299. Write a PL/SQL code block that will accept an account number from the user, check
if the users balance is less than minimum balance, only then deduct rs.100/- from the balance.
This process is fired on the acct table

Ex no: 24
1. Write the SQL queries for the following
300. Retrieve the list of names and the cities of all the clients.
301. List the various products available.
302. Find the names of all clients having a as the second letter in their names.
303. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
304. Write a program using List boxes and combo boxes


Ex no: 25
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
305. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
306. Write a program using List boxes and combo boxes

Ex no: 26
1. Write the SQL queries for the following
20. Rename the column product_rate of Sales_Order_Details tonew_product_rate.
21. List the products in sorted order of their description.
22. Display the order number and date on which the clients placed their order.
307. PL/SQL Program to Display the Fibonacci Series From 1 to 10
308. Write a program using List boxes and combo boxes
Ex no: 27
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000
309. Write a program using List boxes and combo boxes


Ex no: 28
1.Write the SQL queries for the following
25. Find the product with description as HDD1034 and DVDRW
26. List the names, city and state of the clients not in the state of ASSAM
27. List of all orders that were cancelled in the of March.
28. Write a program using List boxes and combo boxes
3.PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 29
310. Write a program using List boxes and combo boxes
311. A student is described by a unique Roll Number, Name Address, and Semester. Each
student enrols himself in an Academic programme offered by a Department. Academic
programmes have programme name(unique), duration, a programme code(unique) and a list
of courses (both core and elective course) while the departments have department code
(unique), department name (unique), HoD who is a Teacher and list of courses offered by it.
Each teacher is described by employee code (unique), name, department and designation. A
student registers some courses in a semester. A course is described by a unique course
number, title of the course, credit allotted for the course and offering department. Database
stores the grades obtained by different student in different courses registered by him/her in
different semesters. Database also stores information about the courses offered by a
department in a semester, the corresponding teacher(s) for each course.
3.PL/SQL Program that Accepts a Number and Find the Factorial
Ex no: 30
312. Write a program using List boxes and combo boxes
2.Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3.PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 31
313. Write a program using List boxes and combo boxes
2.Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3.PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 32
314. Write a program using List boxes and combo boxes
2.Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
3. Retrieve the semester of the student under DBMS subject
3.PL/SQL Program that Accepts a Number and Prints its Binary Format

Ex no: 33
315. Write a program using List boxes and combo boxes
2.Write the SQL queries for the following
22. Retrieve all the student names, and arrange into ascending order.
23. Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
24. Find the total credit point of student required to complete for a course like MCA.
3.PL/SQL Program to Calculate the Compound Interest
Ex no: 34
316. Write a program using List boxes and combo boxes
2.Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3.PL/SQL Program to Calculate the Sum of 1!+2!++n!
Ex no: 35
317. Write a program using List boxes and combo boxes
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
22. List the details of account holders who have a savings account.
23. List the Name and address of account holders with loan amount more than 50,000.
24. Change the name of the customer to ABC whose account number is TU001
3.PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n

Ex no: 36
318. Write a program using List boxes and combo boxes
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
22. List the account number with total deposit more than 80,000.
23. List the number of fixed deposit accounts in the bank.
24. Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3.PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!

Ex no: 37
319. Write a program using List boxes and combo boxes
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
22. Display the detailed transactions on 28th Aug, 2008.
23. Display the total amount deposited and withdrawn on 29th Aug, 2008.
24. List the details of customers who have a loan.
3.PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 38
320. Write a program using List boxes and combo boxes
2.Library information system: Database should store information about books, journals, mgazines
etc. Searching for books can be done by author, title, and subject. Similarly journals canbe searched
by subject area, publisher etc. It should also be possible to see whichbook is issued to which student
and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3.Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 39
321. Write a program using List boxes and combo boxes
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 40
322. Write a program using List boxes and combo boxes
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3.Write a program to demonstrate %type and %rowtype attributes
Ex no: 41
323. Write a program using List boxes and combo boxes
2.Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including results)
prescribed topatients, information if a patient if referred to other expert/hospital. Doctors -
specialization, patients attended etc. Different wards/beds and patients allotted tothem etc. Patient
registration form should include Registration number, Patient name,Address, Gender, Bed number,
date of registration, refer doctor id etc.Doctor information should include Doctor Code, Doctor Name,
and Specializationetc.Lab test information should include Test name, test number, test date, results
andreferred doctors code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3.Write a program to demonstrate predefined exceptions
Ex no: 42
324. Write a program using List boxes and combo boxes
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3.Write a program to demonstrate user defined exceptions
Ex no: 43
325. Write a program using List boxes and combo boxes
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3.create a procedure which generate all the prime numbers below the given number and count
the no.of prime numbers.
Ex no: 44
1.Table Name: Employee















326. 0Get all employee details from the employee table
327. Get First_Name,Last_Name from employee table
328. Get First_Name from employee table using alias name Employee Name

EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance

329. Write a program using List boxes and combo boxes

3.create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/

Ex no: 45
1.Table Name: Employee












34. Get
First_Name
from
employee
table in
upper case
35. G
et
First_Name
from
employee
table in lower case
36. Get unique DEPARTMENT from employee table.
37. Select first 3 characters of FIRST_NAME from EMPLOYEE








330. Write a program using List boxes and combo boxes
3.Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.

Ex no: 46
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance
331. Write a program using List boxes and combo boxes
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
qq) Create the tables with the appropriate integrity constraints
rr) Insert around 10 records in each of the tables
ss) List all the machine allotments with the student names, lab and machine numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 47
332. Write a program using List boxes and combo boxes
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
cc) Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
dd) How many students class wise have allocated machines in the labs
ee) Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
ff) Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
tt) List the total number of lab allotments day wise
uu) Give a count of how many machines have been allocated to the CSIT class
vv) Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 48
333. Write a program using List boxes and combo boxes

2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
o) Create the tables with the appropriate integrity constraints
p) Insert around 10 records in each of the tables
zz) List all the bills for the current date with the customer names and item numbers
aaa) List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 49
334. Write a program using List boxes and combo boxes
2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
bbb) Give a count of how many products have been bought by each customer
ccc) Give a list of products bought by a customer having cust_id as 5
ddd) List the item details which are sold as of today
3.Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 50
335. Write a program using List boxes and combo boxes
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
eee) Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold,
amount
fff) Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department

Part8


Ex. No 1:
1.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints

Insert around 10 records in each of the tables

List all the bills for the current date with the customer names and item numbers

2. Write functions/procedures for the following based on the table employee
336. Write program to compare procedure and sub procedure


Ex no: 2
1.2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

List the total Bill details with the quantity sold, price of the item and the final amount

List the details of the customer who have bought a product which has a price>200

Give a count of how many products have been bought by each customer
18. Search for an employee code and return name, designation and deptno.
19. Write program to compare procedure and sub procedure

Ex no: 3
26. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

Give a list of products bought by a customer having cust_id as 5

List the item details which are sold as of today

Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
27. Prepare a salary slip for the given employee code.
28. Write program to compare procedure and sub procedure

Ex no: 4
28. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
mmmm) Create the tables with the appropriate integrity constraints
nnnn) Insert around 10 records in each of the tables
oooo) List all the student names with their membership numbers

29. Write program to compare procedure and sub procedure
30. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 5
28. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

pppp) List all the issues for the current date with student and Book names
qqqq) List the details of students who borrowed book whose author is CJDATE
rrrr) Give a count of how many books have been bought by each student

29. Write program to compare procedure and sub procedure
30. Write a PL/SQL program to find the factorial of a number.

Ex no: 6
28. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

ssss) Give a list of books taken by student with stud_no as 5
tttt) List the book details which are issued as of today
uuuu) Create a view which lists out the iss_no, iss _date, stud_name, book name
vvvv) Create a view which lists the daily issues-date wise for the last one week

29. Write program to compare procedure and sub procedure
30. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.

Ex no: 7
28. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
dddd) Create the tables with the appropriate integrity constraints
eeee) Insert around 10 records in each of the tables
ffff) List the employee details department wise

29. Write program to compare procedure and sub procedure
30. Write a PL/SQL program to find the total and average of 4 subjects and display the grade

Ex no: 8
28. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
gggg) List all the employee names who joined after particular date
hhhh) List the details of employees whose basic salary is between 10,000 and 20,000
iiii) Give a count of how many employees are working in each department

29. Write program to compare procedure and sub procedure
30. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 9
28. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
jjjj) Give a names of the employees whose netsalary>10,000
kkkk) List the details for an employee_id=5
llll) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
29. Write program to compare procedure and sub procedure
30. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS
Ex no: 10.
28. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

29. Write program to compare procedure and sub procedure

30. Write a PL/ SQL program to generate Fibonacci series

Ex no: 11
28. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

29. Write program to compare procedure and sub procedure
30. Create an Application Using DirListbox, DriveListbox , File Listbox controls

Ex no: 12
28. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

29. Write program to compare procedure and sub procedure
30. To write a PL/SQL program to a function for finding the factorial of given number

Ex no: 13
28. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

29. write a PL/SQL block to apply string functions on a given input string
30. Write program to compare procedure and sub procedure

Ex no: 14
28. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

29. Write program to compare procedure and sub procedure
30. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 15
28. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

29. Write program to compare procedure and sub procedure
30. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
28. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
29. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
30. Write program to compare procedure and sub procedure

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending order of
number of employees.
337. Write program to compare procedure and sub procedure
3.Write a PL/SQL program to swap two numbers

Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
338. Write program to compare procedure and sub procedure
3.Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1.Display the marks of the student number 1 which are equal to the
marks of the student number 2.
339. Create a Calculator Application
3.Write a PL/SQL program to find the total and average of 6 subjects and display the grade
Ex no: 20
1.Finding the names of everybody who works in the same department as
a person called James
340. Write program to compare procedure and sub procedure


3.Write a PL/SQL program to find the sum of digits in a given numbe
Ex no: 21
1.The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
341. Write program to compare procedure and sub procedure
3.Write a PL/SQL program to display the number in reverse order

Ex no: 22
342. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and
the department(consider distinct values). dept_cap contains the capacity for each department.
We need to find those departments(DEPT) where the number of students is less than the total
capacity of the department.
343. Write program to compare procedure and sub procedure
-
3.Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from 3 to 7.
Store the radius and the corresponding values of calculated area in an empty table named areas,
consisting of two columns radius & area
Ex no: 23
344. A database is being constructed for storing sales information system. A product can
be described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
345. Write program to compare procedure and sub procedure

346. Write a PL/SQL code block that will accept an account number from the user, check
if the users balance is less than minimum balance, only then deduct rs.100/- from the balance.
This process is fired on the acct table

Ex no: 24
1. Write the SQL queries for the following
347. Retrieve the list of names and the cities of all the clients.
348. List the various products available.
349. Find the names of all clients having a as the second letter in their names.
350. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
351. Write program to compare procedure and sub procedure


Ex no: 25
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
352. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
353. Write program to compare procedure and sub procedure

Ex no: 26
1. Write the SQL queries for the following
23. Rename the column product_rate of Sales_Order_Details tonew_product_rate.
24. List the products in sorted order of their description.
25. Display the order number and date on which the clients placed their order.
354. PL/SQL Program to Display the Fibonacci Series From 1 to 10
355. Write program to compare procedure and sub procedure
Ex no: 27
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000
356. Write program to compare procedure and sub procedure


Ex no: 28
1.Write the SQL queries for the following
29. Find the product with description as HDD1034 and DVDRW
30. List the names, city and state of the clients not in the state of ASSAM
31. List of all orders that were cancelled in the of March.
32. Write program to compare procedure and sub procedure
3.PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 29
357. Write program to compare procedure and sub procedure
358. A student is described by a unique Roll Number, Name Address, and Semester. Each
student enrols himself in an Academic programme offered by a Department. Academic
programmes have programme name(unique), duration, a programme code(unique) and a list
of courses (both core and elective course) while the departments have department code
(unique), department name (unique), HoD who is a Teacher and list of courses offered by it.
Each teacher is described by employee code (unique), name, department and designation. A
student registers some courses in a semester. A course is described by a unique course
number, title of the course, credit allotted for the course and offering department. Database
stores the grades obtained by different student in different courses registered by him/her in
different semesters. Database also stores information about the courses offered by a
department in a semester, the corresponding teacher(s) for each course.
3.PL/SQL Program that Accepts a Number and Find the Factorial
Ex no: 30
359. Write program to compare procedure and sub procedure
2.Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3.PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 31
360. Write program to compare procedure and sub procedure
2.Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3.PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 32
361. Write program to compare procedure and sub procedure
2.Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
3. Retrieve the semester of the student under DBMS subject
3.PL/SQL Program that Accepts a Number and Prints its Binary Format

Ex no: 33
362. Write program to compare procedure and sub procedure
2.Write the SQL queries for the following
25. Retrieve all the student names, and arrange into ascending order.
26. Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
27. Find the total credit point of student required to complete for a course like MCA.
3.PL/SQL Program to Calculate the Compound Interest
Ex no: 34
363. Write program to compare procedure and sub procedure
2.Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3.PL/SQL Program to Calculate the Sum of 1!+2!++n!
Ex no: 35
364. Write program to compare procedure and sub procedure
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
25. List the details of account holders who have a savings account.
26. List the Name and address of account holders with loan amount more than 50,000.
27. Change the name of the customer to ABC whose account number is TU001
3.PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n

Ex no: 36
365. Write program to compare procedure and sub procedure
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
25. List the account number with total deposit more than 80,000.
26. List the number of fixed deposit accounts in the bank.
27. Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3.PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!

Ex no: 37
366. Write program to compare procedure and sub procedure
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
25. Display the detailed transactions on 28th Aug, 2008.
26. Display the total amount deposited and withdrawn on 29th Aug, 2008.
27. List the details of customers who have a loan.
3.PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 38
367. Write program to compare procedure and sub procedure
2.Library information system: Database should store information about books, journals, mgazines
etc. Searching for books can be done by author, title, and subject. Similarly journals canbe searched
by subject area, publisher etc. It should also be possible to see whichbook is issued to which student
and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3.Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 39
368. Write program to compare procedure and sub procedure
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 40
369. Write program to compare procedure and sub procedure
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3.Write a program to demonstrate %type and %rowtype attributes
Ex no: 41
370. Write program to compare procedure and sub procedure
2.Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including results)
prescribed topatients, information if a patient if referred to other expert/hospital. Doctors -
specialization, patients attended etc. Different wards/beds and patients allotted tothem etc. Patient
registration form should include Registration number, Patient name,Address, Gender, Bed number,
date of registration, refer doctor id etc.Doctor information should include Doctor Code, Doctor Name,
and Specializationetc.Lab test information should include Test name, test number, test date, results
andreferred doctors code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3.Write a program to demonstrate predefined exceptions
Ex no: 42
371. Write program to compare procedure and sub procedure
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3.Write a program to demonstrate user defined exceptions
Ex no: 43
372. Write program to compare procedure and sub procedure
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3.create a procedure which generate all the prime numbers below the given number and count
the no.of prime numbers.
Ex no: 44
1.Table Name: Employee















373. 0Get all employee details from the employee table
374. Get First_Name,Last_Name from employee table
375. Get First_Name from employee table using alias name Employee Name
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance


376. Write program to compare procedure and sub procedure

3.create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/

Ex no: 45
1.Table Name: Employee












38. Get
First_Name
from
employee
table in
upper case
39. G
et
First_Name
from
employee table in lower case
40. Get unique DEPARTMENT from employee table.
41. Select first 3 characters of FIRST_NAME from EMPLOYEE








377. Write program to compare procedure and sub procedure
3.Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.

Ex no: 46
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance
378. Write program to compare procedure and sub procedure
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
ww) Create the tables with the appropriate integrity constraints
xx) Insert around 10 records in each of the tables
yy) List all the machine allotments with the student names, lab and machine numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 47
379. Write program to compare procedure and sub procedure
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
gg) Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
hh) How many students class wise have allocated machines in the labs
ii) Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
jj) Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
zz) List the total number of lab allotments day wise
aaa) Give a count of how many machines have been allocated to the CSIT class
bbb) Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 48
380. Write program to compare procedure and sub procedure

2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
q) Create the tables with the appropriate integrity constraints
r) Insert around 10 records in each of the tables
ggg) List all the bills for the current date with the customer names and item numbers
hhh) List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 49
381. Write program to compare procedure and sub procedure
2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
iii) Give a count of how many products have been bought by each customer
jjj) Give a list of products bought by a customer having cust_id as 5
kkk) List the item details which are sold as of today
3.Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 50
382. Write program to compare procedure and sub procedure
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
lll) Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
mmm) Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department

Part 9


Ex. No 1:
1.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
Create the tables with the appropriate integrity constraints

Insert around 10 records in each of the tables

List all the bills for the current date with the customer names and item numbers

2. Write functions/procedures for the following based on the table employee
383. Write a program using insert sql statement


Ex no: 2
1.2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

List the total Bill details with the quantity sold, price of the item and the final amount

List the details of the customer who have bought a product which has a price>200

Give a count of how many products have been bought by each customer
20. Search for an employee code and return name, designation and deptno.
21. Write a program using insert sql statement

Ex no: 3
29. Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer,item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date,
cust_id: integer, item_id: integer, qty_sold: integer)

Give a list of products bought by a customer having cust_id as 5

List the item details which are sold as of today

Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
Create a view which lists the daily sales date wise for the last one week.
30. Prepare a salary slip for the given employee code.
31. Write a program using insert sql statement

Ex no: 4
31. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)
For the above schema, perform the following
wwww) Create the tables with the appropriate integrity constraints
xxxx) Insert around 10 records in each of the tables
yyyy) List all the student names with their membership numbers

32. Write a program using insert sql statement
33. Write a PL/SQL program that accept N numbers and find the largest and smallest
Number

Ex no: 5
31. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

zzzz) List all the issues for the current date with student and Book names
aaaaa) List the details of students who borrowed book whose author is CJDATE
bbbbb) Give a count of how many books have been bought by each student

32. Write a program using insert sql statement
33. Write a PL/SQL program to find the factorial of a number.

Ex no: 6
31. Database Schema for a Student Library scenario

Student(Stud_no : integer,Stud_name: string)
Membership(Mem_no: integer,Stud_no: integer)
Book(book_no: integer, book_name:string, author: string)
Iss_rec(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)

ccccc) Give a list of books taken by student with stud_no as 5
ddddd) List the book details which are issued as of today
eeeee) Create a view which lists out the iss_no, iss _date, stud_name, book name
fffff) Create a view which lists the daily issues-date wise for the last one week

32. Write a program using insert sql statement
33. To write a PL/SQL program declaration selection, executable selection and Exception
Handling.

Ex no: 7
31. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
mmmm) Create the tables with the appropriate integrity constraints
nnnn) Insert around 10 records in each of the tables
oooo) List the employee details department wise

32. Write a program using insert sql statement
33. Write a PL/SQL program to find the total and average of 4 subjects and display the grade

Ex no: 8
31. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
pppp) List all the employee names who joined after particular date
qqqq) List the details of employees whose basic salary is between 10,000 and 20,000
rrrr) Give a count of how many employees are working in each department

32. Write a program using insert sql statement
33. TO Write a PL/SQL program to find the largest of three numbers

Ex no: 9
31. Database Schema for a Employee-pay scenario

employee(emp_id : integer,emp_name: string)
department(dept_id: integer,dept_name:string)
paydetails(emp_id : integer,dept_id: integer, basic: integer, deductions: integer, additions: integer,
DOJ: date)
payroll(emp_id : integer, pay_date: date)

For the above schema, perform the following
ssss) Give a names of the employees whose netsalary>10,000
tttt) List the details for an employee_id=5
uuuu) Create a view which lists out the emp_name, department, basic, dedeuctions, netsalary
Create a view which lists the emp_name and his net salary
32. Write a program using insert sql statement
33. Write a PL/SQL program by using WHILE LOOPS and FOR LOOPS
Ex no: 10.
31. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the customer names with their membership numbers

32. Write a program using insert sql statement

33. Write a PL/ SQL program to generate Fibonacci series

Ex no: 11
31. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List all the issues for the current date with the customer names and cassette names
List the details of the customer who has borrowed the cassette whose title is The Legend
Give a count of how many cassettes have been borrowed by each customer
Give a list of book which has been taken by the student with mem_no as 5

32. Write a program using insert sql statement
33. Create an Application Using DirListbox, DriveListbox , File Listbox controls

Ex no: 12
31. Database Schema for a Video Library scenario

Customer(cust_no: integer,cust_name: string)
Membership(Mem_no: integer, cust_no: integer)
Cassette(cass_no:integer, cass_name:string, Language: String)
Iss_rec(iss_no: integer, iss_date: date, mem_no: integer, cass_no: integer)
For the above schema, perform the following
List the cassettes issues for today
Create a view which lists outs the iss_no, iss_date, cust_name, cass_name
Create a view which lists issues-date wise for the last one week

32. Write a program using insert sql statement
33. To write a PL/SQL program to a function for finding the factorial of given number

Ex no: 13
31. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Create the tables with the appropriate integrity constraints
Insert around 10 records in each of the tables
List all the machine allotments with the student names, lab and machine numbers

32. write a PL/SQL block to apply string functions on a given input string
33. Write a program using insert sql statement

Ex no: 14
31. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following
List the total number of lab allotments day wise
Give a count of how many machines have been allocated to the CSIT class
Give a machine allotment etails of the stud_no 5 with his personal and class details

32. Write a program using insert sql statement
33. Create a cursor to display the details of all employees, who earn more than Rs. 1000 and who
belong to department number 10, in the following format:

Ex no: 15
31. Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)
For the above schema, perform the following

Count for how many machines have been allocatedinLab_no 1 for the day of the week as
Monday
How many students class wise have allocated machines in the labs
Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
Create a view which lists the machine allotment details for Thursday.

32. Write a program using insert sql statement
33. Write a Pl/Sqlblock which displays area for a given radius. If no data found then display an
error message.
Modify the above problem to demonstrate too_many_values and others exception.

Ex no: 16
31. Perform the following queries based on the EMP and DEPT table
List all the columns of emp and dept table.
List the department numbers and number of employees in each department.
32. Write a PL/SQL block of code such that depending upon the user entered salesman_no, the
commission_amount is calculated and inserted into the commission_payable table.
Salesman_Master (salesman_no, salesman_name, rate_of_commission, tgt_to_get, ytd_sales)
table records the sales informationof different salesperson. A salesman is eligible for
commission only when he achieves the target sales when omission is paid. The commission
amount, the salesman_no and the date_of_payment is recorded in commission_payable table.
Raise an exception if the total sales by a salesman is less than the targe.
33. Write a program using insert sql statement

Ex no: 17
1. Perform the following queries based on the EMP and DEPT table
Hint: Select deptno , count(*) no._of_employees from emp group by deptno;
List the department numbers and the total salary payable in each department.
Hint: Select deptno , sum(sal) from emp group by deptno;
List the jobs and the number of employees in each job. The result should be in descending order of
number of employees.
384. Write a program using insert sql statement
3.Write a PL/SQL program to swap two numbers

Ex no: 18
1. Perform the following queries based on the EMP and DEPT table
Hint: Select job, count(*) no._of_employees from emp group by job order by
no._of_employeesdesc;
List the total salary, maximum, minimum and average salary of the employees job- wise.
List the average salary for each job excluding managers.
List the total salary, maximum, minimum and average salary of the employees job- wise, for
department number 20 only.
List average salary for all departments employing more than 2 people.
385. Write a program using insert sql statement
3.Write a PL/SQL program to find the largest of three numbers

Ex no: 19
1.Display the marks of the student number 1 which are equal to the
marks of the student number 2.
386. Create a Calculator Application
3.Write a PL/SQL program to find the total and average of 6 subjects and display the grade
Ex no: 20
1.Finding the names of everybody who works in the same department as
a person called James
387. Write a program using insert sql statement


3.Write a PL/SQL program to find the sum of digits in a given numbe
Ex no: 21
1.The SQL statement to find the departments that have employees with
a salary higher than the average employee salary
388. Write a program using insert sql statement
3.Write a PL/SQL program to display the number in reverse order

Ex no: 22
389. There are two tables, stu_dept and dept_cap. Stu_dept contains the student name and
the department(consider distinct values). dept_cap contains the capacity for each department.
We need to find those departments(DEPT) where the number of students is less than the total
capacity of the department.
390. Write a program using insert sql statement
-
3.Write a PL/SQL code block to calculate the area of a circle for a value of radius varying from 3 to 7.
Store the radius and the corresponding values of calculated area in an empty table named areas,
consisting of two columns radius & area
Ex no: 23
391. A database is being constructed for storing sales information system. A product can
be described with a unique product number, product name, selling price, manufacturer name.
The product can sale to a particular client and each client have it own unique client number,
client name, client addresses, city, pin code, state and total balance to be required to paid.
Each client order to buy product from the salesman. In the order, it has unique sales order
number, sales order date, client number, salesman number (unique), billed whole payment by
the party or not and its delivery date. The salesman have the name, addresses, city, pin code,
state, salary of the sales man, delivery date, total quantity ordered, product rate.
392. Write a program using insert sql statement

393. Write a PL/SQL code block that will accept an account number from the user, check
if the users balance is less than minimum balance, only then deduct rs.100/- from the balance.
This process is fired on the acct table

Ex no: 24
1. Write the SQL queries for the following
394. Retrieve the list of names and the cities of all the clients.
395. List the various products available.
396. Find the names of all clients having a as the second letter in their names.
397. PL/SQL Program to Find Sum of all Odd Numbers From 1 to 100
398. Write a program using insert sql statement


Ex no: 25
1. Write the SQL queries for the following
List all the clients who are located in TEZPUR.
Find the products whose selling price is greater than 2000 and less than or equal to 5000
Add a new column NEW_PRICE into the product_master table.
399. PL/SQL Program to Generate all Prime Numbers Between 1 to 100
400. Write a program using insert sql statement

Ex no: 26
1. Write the SQL queries for the following
26. Rename the column product_rate of Sales_Order_Details tonew_product_rate.
27. List the products in sorted order of their description.
28. Display the order number and date on which the clients placed their order.
401. PL/SQL Program to Display the Fibonacci Series From 1 to 10
402. Write a program using insert sql statement
Ex no: 27
1. Write the SQL queries for the following
Delete all the records having delivery date before 25
th
August, 2008.
Change the delivery date of order number ON01008 to 16-08-08
Change the bal_due of client_no CN01003 to 1200
2. PL/SQL Program to Generate all Armstrong Numbers From 1 to 1000
403. Write a program using insert sql statement


Ex no: 28
1.Write the SQL queries for the following
33. Find the product with description as HDD1034 and DVDRW
34. List the names, city and state of the clients not in the state of ASSAM
35. List of all orders that were cancelled in the of March.
36. Write a program using insert sql statement
3.PL/SQL Program to Check Whether the Number is Armstrong or Not

Ex no: 29
404. Write a program using insert sql statement
405. A student is described by a unique Roll Number, Name Address, and Semester. Each
student enrols himself in an Academic programme offered by a Department. Academic
programmes have programme name(unique), duration, a programme code(unique) and a list
of courses (both core and elective course) while the departments have department code
(unique), department name (unique), HoD who is a Teacher and list of courses offered by it.
Each teacher is described by employee code (unique), name, department and designation. A
student registers some courses in a semester. A course is described by a unique course
number, title of the course, credit allotted for the course and offering department. Database
stores the grades obtained by different student in different courses registered by him/her in
different semesters. Database also stores information about the courses offered by a
department in a semester, the corresponding teacher(s) for each course.
3.PL/SQL Program that Accepts a Number and Find the Factorial
Ex no: 30
406. Write a program using insert sql statement
2.Write the SQL queries for the following
Find all the students name, city, course allotted from the CSE department.
List the total number of Faculty in the CSE department.
List the available courses from the CSE department.
3.PL/SQL Program to Display the Factorials of Numbers From 1 to 10

Ex no: 31
407. Write a program using insert sql statement
2.Write the SQL queries for the following
List the all students in a particular semester.
List the students who earned CGPA greater than or equal to 8.5
How much subjects are registered by a student in each semester.
3.PL/SQL Program to Accept a Number and Display it in the Octal Format

Ex no: 32
408. Write a program using insert sql statement
2.Write the SQL queries for the following
List the common students who are allotted the same courses of both the programme MCA and
M.Tech.
List the total number of student enrolled in the subject DBMS.
3. Retrieve the semester of the student under DBMS subject
3.PL/SQL Program that Accepts a Number and Prints its Binary Format

Ex no: 33
409. Write a program using insert sql statement
2.Write the SQL queries for the following
28. Retrieve all the student names, and arrange into ascending order.
29. Modify a student address Guwahati to Tezpur where sdt_id=CSI08002.
30. Find the total credit point of student required to complete for a course like MCA.
3.PL/SQL Program to Calculate the Compound Interest
Ex no: 34
410. Write a program using insert sql statement
2.Write the SQL queries for the following
List the all courses which are related to computer science.
Retrieve all the students located at Tezpur.
Find the total number of department in our database.
3.PL/SQL Program to Calculate the Sum of 1!+2!++n!
Ex no: 35
411. Write a program using insert sql statement
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
28. List the details of account holders who have a savings account.
29. List the Name and address of account holders with loan amount more than 50,000.
30. Change the name of the customer to ABC whose account number is TU001
3.PL/SQL Program to Calculate the Sum of 1+1/2+1/3++1/n

Ex no: 36
412. Write a program using insert sql statement
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
28. List the account number with total deposit more than 80,000.
29. List the number of fixed deposit accounts in the bank.
30. Display the details of customers who created their accounts between 20-jan08 to 20-aug-
08.
3.PL/SQL Program to Calculate the Sum of 1/1!+1/2!+..+1/n!

Ex no: 37
413. Write a program using insert sql statement
2.A bank database keeps record of the details of customers, accounts, loans and transactions such as
deposits or withdraws. Customer record should includecustomer id, customer name, address, age,
contact number, email id etc.,accounts details involves account number, account type(fixed
account, savingsaccount, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particularaccount and the date of
transaction. The database should also store record ofloans which include loan amount, loan date and
the account number to which theloan is granted.Make appropriate tables for the above database and
try to find out the followingqueries:
28. Display the detailed transactions on 28th Aug, 2008.
29. Display the total amount deposited and withdrawn on 29th Aug, 2008.
30. List the details of customers who have a loan.
3.PL/SQL Program to Calculate the Sum of 1/1!+2/2!++n/n!

Ex no: 38
414. Write a program using insert sql statement
2.Library information system: Database should store information about books, journals, mgazines
etc. Searching for books can be done by author, title, and subject. Similarly journals canbe searched
by subject area, publisher etc. It should also be possible to see whichbook is issued to which student
and belonging department.
List the names of the books issued between 21-aug-08 and 29-Aug-08.
Retrieve the name and number of books by a particular author.
Retrieve the name of the publisher which has maximum number of books.
3.Implement PL/SQL Program using: old and: new bind Variable.

Ex no: 39
415. Write a program using insert sql statement
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Count the total number of books in the library.
Count the number of books issued to a student with Roll no CSB06001
Change the author of the book to ABC with book id=BK003.
3.Write a program to demonstrate the GOTO statement

Ex no: 40
416. Write a program using insert sql statement
2.Library information system:
Database should store information about books, journals, mgazines etc. Searching for books can be
done by author, title, and subject. Similarly journals canbe searched by subject area, publisher etc. It
should also be possible to see whichbook is issued to which student and belonging department.
Retrieve the name of the student to whom the book named Database System,by E.Navathe
is issued.
Display the total number of books issued to different departments.
List the name of the books where subject is like ora
3.Write a program to demonstrate %type and %rowtype attributes
Ex no: 41
417. Write a program using insert sql statement
2.Hospital information system:Patients - indoor/outdoor, medicines/lab tests (including results)
prescribed topatients, information if a patient if referred to other expert/hospital. Doctors -
specialization, patients attended etc. Different wards/beds and patients allotted tothem etc. Patient
registration form should include Registration number, Patient name,Address, Gender, Bed number,
date of registration, refer doctor id etc.Doctor information should include Doctor Code, Doctor Name,
and Specializationetc.Lab test information should include Test name, test number, test date, results
andreferred doctors code.Bed information should include bed number, ward number and status
(whetherallotted or not).
Queries:
Display the details of patients admitted between 20-jul-02 and 20-aug-08.
Change the name of the patient to Ram whose patient id=PT011
Display the names of the patients and lab test results performed on 20-jul08.
3.Write a program to demonstrate predefined exceptions
Ex no: 42
418. Write a program using insert sql statement
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Display the number of patients taking treatment under doctor =ABC.
Retrieve the name of doctor who is taking care of maximum number of patients.
Change the bed number of the patient to 456 where patient id=PT023
3.Write a program to demonstrate user defined exceptions
Ex no: 43
419. Write a program using insert sql statement
2.Hospital information system:
Patients - indoor/outdoor, medicines/lab tests (including results) prescribed topatients, information if a
patient if referred to other expert/hospital. Doctors -specialization, patients attended etc. Different
wards/beds and patients allotted tothem etc. Patient registration form should include Registration
number, Patient name,Address, Gender, Bed number, date of registration, refer doctor id etc.Doctor
information should include Doctor Code, Doctor Name, and Specializationetc.Lab test information
should include Test name, test number, test date, results andreferred doctors code.Bed information
should include bed number, ward number and status (whetherallotted or not).
Queries:
Change the status of bed with bed number 123 with not allotted.
List the bed details which are free in ward number 10.
List the name of male patients in ward no 13 taking treatment under doctor XYZ
List the details of patients with age more than 50 taking treatment under a doctor, whose
name like das.
3.create a procedure which generate all the prime numbers below the given number and count
the no.of prime numbers.
Ex no: 44
1.Table Name: Employee















420. 0Get all employee details from the employee table
421. Get First_Name,Last_Name from employee table
422. Get First_Name from employee table using alias name Employee Name

EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT
1 John Abraham 1000000 01-JAN-13
12.00.00 AM
Banking
2 Michael Clarke 800000 01-JAN-13
12.00.00 AM
Insurance
3 Roy Thomas 700000 01-FEB-13
12.00.00 AM
Banking
4 Tom Jose 600000 01-FEB-13
12.00.00 AM
Insurance
5 Jerry Pinto 650000 01-FEB-13
12.00.00 AM
Insurance
6 Philip Mathew 750000 01-JAN-13
12.00.00 AM
Services
7 TestName1 123 650000 01-JAN-13
12.00.00 AM
Services
8 TestName2 Lname% 600000 01-FEB-13
12.00.00 AM
Insurance

423. Write a program using insert sql statement

3.create a procedure which updates the salaries of an employees as follows.
1)ifsal<1000 then update the salry to 1500.
2)ifsal>=1000 and <=2400 then update the salary to 2500.*/

Ex no: 45
1.Table Name: Employee












42. Get
First_Name
from
employee
table in
upper case
43. G
et
First_Name
from
employee
table in lower case
44. Get unique DEPARTMENT from employee table.
45. Select first 3 characters of FIRST_NAME from EMPLOYEE








424. Write a program using insert sql statement
3.Write PL/SQL program uses a cursor to select the five highest paid employees from the Emp
table.

Ex no: 46
EMPLOYEE_REF_ID INCENTIVE_DATE INCENTIVE_AMOUNT
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
EMPL
OYEE
_ID
FIRST_NAME LAST_NA
ME
SALARY JOINING_DATE DEPARTM
ENT
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance
425. Write a program using insert sql statement
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
ccc) Create the tables with the appropriate integrity constraints
ddd) Insert around 10 records in each of the tables
eee) List all the machine allotments with the student names, lab and machine numbers

3.Program to illustrate the use of attribute SQL%FOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 47
426. Write a program using insert sql statement
2.Database Schema for a student-Lab scenario

Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
kk) Count for how many machines have been allocatedinLab_no 1 for the day of the
week as Monday
ll) How many students class wise have allocated machines in the labs
mm) Create a view which lists out the stud_no, stud_name, mach_no, lab_no, dayofweek
nn) Create a view which lists the machine allotment details for Thursday
Database Schema for a student-Lab scenario
Student(stud_no: integer, stud_name: string, class: string)
Class(class: string,descrip: string)
Lab(mach_no: integer, Lab_no: integer, description: String)
Allotment(Stud_no: Integer, mach_no: integer, dayof week: string)

For the above schema, perform the following
fff) List the total number of lab allotments day wise
ggg) Give a count of how many machines have been allocated to the CSIT class
hhh) Give a machine allotment etails of the stud_no 5 with his personal and class details
3.Program to illustrate the use of attribute SQL%NOTFOUND in Implicit Cursor. The
Program is to find out the salary of an employee from emp table whose two fields are
emp_sal and emp_no.

Ex no: 48
427. Write a program using insert sql statement

2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
s) Create the tables with the appropriate integrity constraints
t) Insert around 10 records in each of the tables
nnn) List all the bills for the current date with the customer names and item numbers
ooo) List the total Bill details with the quantity sold, price of the item and the final amount
3.Program to illustrate the use of attribute SQL%ROWCOUNT in Implicit Cursor. The
Program is to update the salary of each employee by 1000.

Ex no: 49
428. Write a program using insert sql statement
2.Database Schema for a customer-sale scenario

Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
ppp) Give a count of how many products have been bought by each customer
qqq) Give a list of products bought by a customer having cust_id as 5
rrr) List the item details which are sold as of today
3.Program to illustrate the use of Explicit Cursors. The Program is to display the
information of employess (Emp No, Name and Salary) of a given department.

Ex no: 50
429. Write a program using insert sql statement
2.Database Schema for a customer-sale scenario
Customer(Cust id : integer, cust_name: string)
Item(item_id: integer, item_name: string, price: integer)
Sale(bill_no: integer, bill_data: date, cust_id: integer, item_id: integer, qty_sold: integer)

For the above schema, perform the following
sss) Create a view which lists out the bill_no, bill_date, cust_id, item_id, price, qty_sold, amount
ttt) Create a view which lists the daily sales date wise for the last one week

3.Program to illustrate the use of Explicit Cursors with FOR LOOP. The Program is to
display the information of employess of a given department

Anda mungkin juga menyukai