0% found this document useful (0 votes)
702 views

DBMS Lab QB

The document contains instructions for creating various database tables with attributes and constraints, and writing queries and procedures to manipulate the data. Tasks include creating tables for customers, loans, employees, departments, voters, books, and more. Questions ask to list, update, and retrieve data from the tables, create views, functions, triggers and exceptions. Procedures are also asked to handle exceptions and return values. Forms are asked to be designed for login, adding and deleting records.

Uploaded by

Rogith M
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
702 views

DBMS Lab QB

The document contains instructions for creating various database tables with attributes and constraints, and writing queries and procedures to manipulate the data. Tasks include creating tables for customers, loans, employees, departments, voters, books, and more. Questions ask to list, update, and retrieve data from the tables, create views, functions, triggers and exceptions. Procedures are also asked to handle exceptions and return values. Forms are asked to be designed for login, adding and deleting records.

Uploaded by

Rogith M
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 17

1.

Create the following tables with given attributes having appropriate data
type and specify the necessary primary and foreign key constraints:
Customer (Custid, Custname, Age, phone)
Loan (Loanid, Amount, Custid, EMI)
a) List the name of the customers who have taken loan for more than Rs.50,000.
b) List the Customer id of those who have no loan.
c) List the total count of loan availed.
d) Create a procedure to print the Amount and Custid when the Loanid is given as
input. Handle Exceptions.
Table creation with Appropriate Constraints and Data Type (15)

2. Create the following tables with given attributes having appropriate data
type and specify the necessary primary and foreign key constraints:
Employee (EmpId, Empname, Sal, Deptno)
Dept (Deptno, Dname, Loc,DeptmanagerId)
a) List the count of Employees and average salary of each department.
b) List the employee name, department name and the salary of all the employees.
c) Display the Employee name and the respective department manager name.
d) Create a function to return the salary of the employee when Empid is given as
input parameter. Handle Exceptions.
Table creation with Appropriate Constraints and Data Type (15)

3. . Create the following tables with given attributes having appropriate


data type and specify the necessary primary and foreign key constraints:
Voter (VoterId, Votername, Gender, Boothid,Checkvote)
checkvote is 1(voted) or 0 (not voted)
Booth (Boothid, Location,BIncharge )
a) (i)List the count of voters in each Booth (ii) List the count of Male voters
voted.
b) Display the overall count of voters voted in the election.
c) Display the Boothid, Location and count of voters voted.
d) Write a function to return the percentage of poll in a booth when boothid is
given as input. Handle Exceptions.
Table creation with Appropriate Constraints and Data Type (15)

4. Create the following tables with given attributes having appropriate data
type and specify the necessary primary and foreign key constraints:
User (Userid, Name, Dept, Bookid, Accdate)
Book (Bookid, Book_name, Author, Publication, Price)
a) List the name of the user who had accessed the costliest book.
b) List the userid and count of books accessed by the user.
c) List the books published by Wiley publisher.
d) Write a PL/SQL program to print the details of the book when Bookid is given as
input. Handle appropriate exceptions.

5. Create the following tables with given attributes having appropriate


data type and specify the necessary primary and foreign key constraints:
Customer (Custid, Custname, Addr, phno,panno)
Loan (Loanid, Amount, Interest, Custid)
Account (Acctno, Accbal, Custid)
a. Display the Account balance amount of a particular customer �ARUN�
b. Update the interest with 1% when Accbal of the Custid >50% of Loan Amount
c. Create a View with Accbal and Loan Amount of all Customers
d. Create a trigger which checks for minimum balance in the account.
6. Create the following tables with given attributes having appropriate data
type and specify the necessary primary and foreign key constraints:
Customer (Custid, Custname, phno,pan,DOB)
HomeLoan (HLoanid, Amount, Custid)
VehicleLoan (VLoanid, Amount, Custid)
a) List the Custid of the customers who have both homeloan and vehicle loan.
b) List the Custid of the customers who donot have any loan.
c) Create a view with customerid, Customer name and total loan amount (HomeLoan and
VehicleLoan)
d) Write a trigger which displays the Homeloan details whenever the values are
inserted in the respective table.

7. Create the following tables with given attributes having appropriate data
type and specify the necessary primary and foreign key constraints:
Product (Prodid, Prodesc, Price, Stock)
Sales (Salesid, Prodid, qty)
a) Add a column reorder in Product table having value 50 for all products.
b) Create a Login form to validate a user.
c) Create a Form using Menus to
(i) Add a product.
(ii) Delete a product.

8. Create the following tables with given attributes having appropriate data
type and specify the necessary primary and foreign key constraints:
Product (Prodid, Prodesc, Price, Stock)
Sales (Salesid, Prodid, qty)
a) Add a column reorder in Product table having value 50 for all products.
b) Display the Sales Report.
c) Create an application for
i) User Login &
ii) checking the availability of a product in a stock.

9. Design a Database for Library Management System using ER Diagram.


Create the following table with the given attributes having appropriate data type
and specify the necessary key constraints.
� BOOK(Bookcode,Name,Author,Price,Publish)
Design forms to
a) Login
b) Add & delete book details
ER Diagram (15) marks

10. Create an application for student contacts management application. The


application enables a faculty user to login and search the details of a Student
(Name, Address, Contact no, Email id, parent contact) with his register number.
Create necessary tables and Forms.

11. Create an application for Quiz system. Create the necessary table(s) with
attributes having appropriate data type and specify the necessary key constraints.

12. Create the following tables with given attributes having appropriate data
type and specify the necessary primary and foreign key constraints:
Marks(Regno,Name , Dept, Subj1,Subj2,Subj3)
a) Add a column Total in student table and update the Total field with the sum of 3
subject Marks.
b) Find the second maximum total in the table.
c) Display the name of the student with maximum total.
d) Write a PL/SQL program to display the report sheet of the students using
cursors.

13. Write the Query statement for the following:


a. Return the login�s user name.
b. Calculate your age using PL/SQL in built function with DOB.
c. Retrieve the word DATA from the String DATABASE.
d. Display the day of the today�s date.
e. Create a table with a field and use a sequence to insert values from 1 t0 50
into the field.
f. Create a Student table (Regno, name, dept) and populate with data.
g. Create a view for CSE dept with the details of students of CSE dept.
h. Implement TCL commands with student table.
i. Write a PL/SQL program to find the details of the student when regno is given
as input. Handle Exceptions.

14. Create the following tables with the mapping given below.
stu_details (reg_no, stu_name, DOB, address, city)
mark_details (reg_no, mark1, mark2, mark3, total)
(a) Alter the table mark_details to add a column average with data type as long.
(b) Display the months between the DOB and till date.
(c) Using alter command drop the column address from the table stu_details.
(d) Write a PL/SQL program to find the sum & average marks of all the student using
procedures.

15. Create the following tables with the mapping given below.
Employee (Empno, Ename, Job, MgrId, DoB, DoJ, Sal, Comm, Deptno)
Department (Dname, Deptno, Dloc)
(a) Display the Emp no, name, salary and experience of each employee ordered by
salary (highest to lowest)
(b) List the names of the employee working for �Marketing� Department.
(c) List the names of the employees born in the current month.
(d) Write a PL/SQL function to display the details of the employee when Employee no
given as input. Handle Exceptions.

16.
17. (a) Create a table Student (Regno, name , Mark) and insert records. Write a
PL/SQL function to print the grade of the Student. Obtain student mark as input
from the main program. Check for the following condition: if the input mark ranges
91-100 then Grade A, 81-90 then Grade B, 71-80 then Grade C, 60-70 then Grade D and
<60 Grade E.
(b) Develop an application for Banking System. Design a Database schema and create
necessary tables and forms.

18. (a)Write a PL/SQL program to print the payslip of the employee. Create a
table Employee (Id, Name, Basicpay, DOB,Dept).Obtain Employeeid as input from the
main program. (Basic pay +DA+HRA-TAX-DED). Assume the Allowances and Deduction %.
(b) Develop an application for Employee payroll processing System to add, delete,
update employee particulars and generate payslip with the employee table created in
19. (a) Create a table Bank (acc_no, name, balance) and insert records into the
table. Write a PL/SQL program for the Bank table to notify the user if the account
balance is less than 500. Obtain account no as input. Handle Exceptions.
(b) Develop an application for inventory management System. Design a Database
schema and Create necessary tables and forms.

20. (a) Create the table Book (acc_no, username, bookno, days) and insert few
records into the table. Write a PL/SQL Program to calculate the fine for library
book (Rs 5 /day). (Hint: fine =days*5). Obtain account no as input. Handle
Exceptions.
(b). Design a Database schema for Library management System. Develop an application
for managing book details in Library management System .

-----------------------------------------------------------------------------------
-------------------------------------
1. Consider the Insurance database given below.
PERSON(driver_ID, name, address)
CAR(regno, model,year )
ACCIDENT(report_number,accd_date,location)
OWNS(driver_id,regno)
PARTICIPATED(driver_id,regno,report_number,damage_amount)
i. Specify the primary keys and foreign keys and enter at least five tuples for
each relation.
ii. Update the damage amount for the car with specific regno in the accident with
report number 1025.
iii. Add a new accident to the database.
iv. Find the total number of people who owned cars that were involved in
accidents in the year 2018.
v. Find the number of accidents in which cars belonging Wagon R were involved.

2. Create the Book database and do the following:


book(book_name,author_name,price,quantity).
i. Write a query to update the quantity by double in the table book.
ii. List all the book_name whose price is greater than those of book named
"Database for Dummies".
iii. Retrieve the list of author_name whose first letter is �a� along with the
book_name and price.
iv. Write a PL/SQL Procedure to find the total number of books of same author.
3. Create the Company database with the following tables and do the following:
Administration(employee_salary, development _cost, fund_amount, turn_over,bonus)
Emp_details (emp_no, emp_name, DOB, address, doj, mobile_no, dept_no, salary).
i. Calculate the total and average salary amount of the employees of each
department.
ii. Display total salary spent for employees.
iii. Develop a PL/SQL function to display total fundamount spent by the
administration department .

4. Create the student database with the following tables and do the following:
assessment(reg_no,name, mark1, mark2, mark3, total)
dept_details (dept_no, dept_name, location).
i. Using alter command drop the column location from the table dept_details.
ii. Display all dept_name along withdept_no.
iii. Drop the table dept_details.
iv. Write a PL/SQL Trigger to verify the data before insertion on assessment
table.
5. Consider the following Tables for a bus reservation system application:
BUS (ROUTENO, SOURCE, DESTINATION)
PASSENGER (PID, PNAME, DOB, GENDER)
BOOK_TICKET (PID, ROUTENO, JOURNEY_DATE, SEAT_NO)
i. Include constraint that DOB of passenger should be after 2000
ii. Display the passengers who had booked the journey from Mumbai to Chennai on
02-Feb-2019
iii. List the details of passengers who have traveled more than three times on the
same route.
iv. Create a View that displays the RouteNo, source, destination and journey_date
which moves from Chennai to Delhi.
v. In the above created procedure, include exceptions to display "No ticket
booked on specified date" for a given journey_date.

6. Consider the following tables.


SAILOR(sid, sname, rating, age)
BOATS(bid, bname, colour)
RESERVES(sid, bid, day)
i. List the sailors in the descending order of their rating.
ii. List the sailors whose youngest sailor for each rating and who can vote.
iii. List the sailors who have reserved for both �RED� and �GREEN� boats.
iv. Create synonym for sailor table.
v. Create a PL / SQL Function that accepts SID and returns the name of sailor.

7. Consider the following relations for an order processing application:


CUSTOMER (CID, NAME)
PRODUCT (PCODE, PNAME, UNIT_PRICE)
CUST_ORDER (OCODE, ODATE, CID)
ORDER_PRODUCT (OCODE, PCODE, QTY)
i. Develop a Trigger to ensure the product to be Pen , Eraser, Pencil during
insertion
ii. Develop a PL/SQL Function to calculate the total cost of ordered product.
iii. Use Sequence for PCODE insertion in product table
8. Consider the following relations for a transport management system
application:
DRIVER (DCODE, DNAME, DOB, GENDER)
CITY (CCODE, CNAME)
TRUCK (TRUCKCODE, TTYPE)
i. Include the constraint as mentioned above and the gender of driver is always
'male'.
ii. Develop a SQL query to list the details of each driver and the number of
trips traveled.
iii. Create an index on truck_code in Drive_truck table .
iv. Use Cursor to display the details of all drivers, and the truck_code
9. Consider the following relational schema for a banking database application:
CUSTOMER (CID, CNAME)
BRANCH (BCODE, BNAME)
ACCOUNT (ANO, ATYPE, BALANCE, CID, BCODE)
TRANSACTION (TID, ANO, TTYPE, TDATE, TAMOUNT)
i. Develop a SQL query to list the details of branches and the number of
accounts in each branch.
ii. Develop a SQL query to list the details of customers who have performed the
most transactions today
iii. Create a view that will keep track of the details of each customer and
account details who have both savings and current account.
iv. Develop a database trigger that will update the value of BALANCE in ACCOUNT
table when a record is inserted in the transaction table
10. Consider the following database of student enrollment in courses and books
adopted for that course.
STUDENT(regno, name, major, bdate)
COURSE(courseno, cname, dept)
ENROLL(regno, courseno, sem, marks)
i. Display the total number of students register for more than two courses in a
department specified.
ii. Display the students who have secured the highest mark in each course
iii. List the youngest student of each course in all departments.
iv. Develop PL/SQL Cursor that selects marks of a particular student in a
specified semester.

11. The following are maintained by a book dealer.


AUTHOR(author_id, name, city, country)
PUBLISHER(publisher_id, name, city, country)
CATALOG(book_id, title, author_id, publisher_id , category_id, year, price)
CATEGORY(category_id, description)
ORDER_DETAILS(order_no, book_id, quantity)
i. List the author of the book that has minimum sales.
ii. Display total number of books in each category.
iii. Develop a PL/SQL procedure that updates the price of the book by 10% those
with maximum sales.

12. Create the student database with the following tables and do the following:
mark_details(reg_no,name, mark1, mark2, mark3, total)
dept_details (dept_no, dept_name, HOD)
stud_details(reg_no,name, dob, address)
i. Using alter command to assign foreign key in mark_details.
ii. Display the address of the students who have secured the top three ranks.
iii. Write a PL/SQL procedure to update the grade according to the marks secured.

13. Create a database for IoT simulator with the following tables.
Device_details (deviceID, devicename, properties)
Connect_status(deviceID, loginTime, logoutTime)
Transaction_details(transID, deviceID, updatedProperties, timeofUpdation)
i. List the details of the devices that are connected in a particular session
ii. Display the details of the device and its property that has been active for
most of the time.
iii. Develop a PL/SQL procedure that deletes the details of the devices that have
been least updated.

14. Create a database for maintaining the cloud database


PAAS_details(server, platform, startDate, endDate, rate)
SAAS_details(server, software, startDate, endDate, rate)
DAAS_details(server, database, startDate, endDate, rate)
transaction(service, logintime, logouttime)
i. List the details of the services requested from 5th Feb to 10th Feb, 2019.
ii. Display the details of the service that are least used and most used.
iii. Develop a PL/SQL function that returns the total amount invested on platform
service in the month of February.

15. Create a database for Placement and Training cell.


Stud_details(regno, name, dept, percentage)
Company(companyID,name, noOfVacancy)
Training_Details(CourseID, name, Trainer)
Placed(regno, companyID,minSal)
i. List the students who are eligible for recruitment in a particular company.
ii. Display the student who has been placed with highest salary
iii. Develop a PL/SQL exception that provides an alternate for not eligible
students.

16. Create a database for Timetable generation using the following tables:
Faculty_details(FacultyID,FacultyName, dept)
Subject_details(Subcode, subtitle, dept, year)
Subject_allocated(Subcode, year, dept,FacultyID)
Timetable(period, timefrom, timeto, Subcode,year,dept)
i. Display the timetable of individual faculty
ii. Display the timetable of each class separately
iii. Display the timetable of particular subject
iv. Develop a PL/SQL procedure that displays individual class timetable
17. Create a database for Transportation management system in an organization.
Identify appropriate tables and optimize them using normalization. Develop an
application using front end designing with backend database connectivity.

18. Create a database for listing the academic performance of affliated colleges
under Anna Univeristy. Identify the tables needed. Apply normalization on
identified tables. Develop an application with suitable UI design and finally
generate the academic performance.

19. Develop an application with front end design for Railway Ticket Reservation
system using approriate database system.

20. Develop an application for students attendance tracking and reporting system
with good UI design and database connectivity.

-----------------------------------------------------------------------------------
-----------------------------------------------
Q.NO. EXPERIMENT LIST
1. Create a Table as workers and the details are { S.No, Name, Designation,
Branch }
Perform the following commands:
? Alter the table by adding a column Salary
? Alter the table by modifying the column Name
? Describe the table employee
? Copy the table employee as emp
? Truncate the table
? Delete the Second row from the table
? Drop the table

2. Create the following tables


student_details {register_no, student_name, DOB, address, city}
mark_details {register_no, mark1, mark2, mark3, total }
? Display only those rows whose total ranges between 250 and 300.
? Drop the table mark_details and Delete the row whose register_no=161.
? Display all details whose names begins with 'a'.

3. Consider the following relational schema for a Loan database application:


Customer {Customer_id, Customer_name, Age, phone_no}
Loan { Loan_id, Amount, Customer_id)}
? Include the constraint on Loan_id that it starts with letter �L�.
? Display the list of the customer_ids and total Loan amount taken.
? Display the Customer_id and Customer_name who have taken less than two loans.

4. Consider the following database for a Banking Enterprise.


Branch{branch_name, branch_city, assets) ACCOUNT(accno, branch_name, balance}
Depositor {customer_name, accno) CUSTOMER(customer_name, customer_street,
customer_city}
Loan {loan_number, branch_name, amount}
Borrower { customer_name, loan_number)}
? Create the above tables by properly specifying the primary keys and foreign
keys and
enter at least five tuples for each relation.
? Find all the customers who have at least two accounts at the main branch.
? Find all the customers who have an account at all the branches located in a
specific city.
? Demonstrate how you delete all account tuples at every branch located in a
specific city.

5. Write a procedure called proc_udate is created and stored in the database.


This procedure when called in PL/SQL block updates the qty_on_hand in the
product_master table it also updates the order_status in the sales_order table.
? Prodct_master { product_no, description, profit_percentage, unit_measure,
qty_on_hand, recorder_level, sell_price, cost_price }
? Sales_order {order_no, order_date, client_no, dely_address, salesman_no,
dely_type, billed_yn, delay_date, order_status }

6. Consider the following database consisting of the following tables:


Hostel (hno, hname, type [boys/girls])
Menu (hno, day, breakfast, lunch, dinner)
Warden (wname, qual, hno)
Student (sid, sname, gender, year, hno)
? Display the total number of girls and boys hostel in the college.
? Display the menu in the hostel �x� on Tuesday.
? Display the number of wardens for each hostel.II.

7. Consider a view branch_cust defined as follows:


Create view branch_cust as
select branch_name, customer_name
from depositor, account
where depositor.account_number = account.account_number.
suppose that a view is materialized; that is the view is computed and stored. Write
a trigger to maintain the view, that is, to keep it up-to-date on insertions to and
deletions from depositor or account. Do not bother about updates.

8. Create an Employee table with an attributes { empid, empname, department


designation, Gross_salary . Using cursor, select the five highest paid employees
from the Employee table.

9. The accounts table is modified according to instructions stored in the action


table. Each row in the action table contains an account number, an action to be
taken (I, U, or D for insert, update, or delete), an amount by which to update the
account, and a time tag used to sequence the transactions.
On an insert, if the account already exists, an update is done instead. On an
update, if the account does not exist, it is created by an insert. On a delete, if
the row does not exist, no action is taken.
10. Suppose you have a table named data_table that holds data collected from
laboratory experiments, and you want to analyze the data from experiment 1.Compute
the results and store them in a database table named temp.

11. Write a program in PL/SQL to create a cursor displays the name and salary of
each employee in the Employees table whose salary is less than that specified by a
passed-in parameter value.

12. Given Student_Report Database, in which student marks assessment is recorded.


In such schema, create a trigger so that the total and average of specified marks
is automatically inserted whenever a record is insert.

13. Write a PL/SQL function to calculate the income tax for the given employee:
Conditions:
If pay ? 2,50,000, no tax is charged.
If pay is ? 2,50,001 and ? 5,00,000, 5% of pay is charged as tax.
If pay is ? 5,00,001 and ? 10,00,000, 20% of pay is charged as
tax.
If pay is ? 10,00,001, 30% of pay is charged as tax. .

14. Design a database for an Airline. The database must keep track of customers
and their reservations, flights and their status, seat assignments on individual
flights, and the schedule and routing of future flights.
Your design should include an E-R diagram, a set of relational schemas, and a list
of constraints, including primary-key and foreign-key constraints.

15. Consider a database used to record the marks that students get in different
exams of different courses offerings.
? Construct an ER diagram that models exams as entites, and uses a ternary
relationship, for the database.
? Construct and alternative ER diagram that uses only a binary relationship
between students and course_offerings. Make sure that only one relationship exists
between a particular student and course offering pair, yet you can represent the
marks that a student gets in different exams of a course offering.

16. Consider the employee relational database, Where the primary keys are
underlined.
Employee ( employee_name, street, city)
Works ( employee_name, company_name, salary)
Company ( comapny_name, city)
Manages ( employee_name, manager_name)
? Find all employees in the database who earn more than each employee of Small
Bank Corporation.
? Assume that the companies may be located in several cities. Find all
companies located in every city in which Small Bank Corporation is located.
? Give all managers of first Bank Corporation a 10 percent raise unless the
salary becomes greater than $100,000; in such cases, give only a 3 percent raise.
17. Consider the following relational schema:
Employee( empno, name, office, age )
Books ( isbn, title, authors, publisher )
Loan ( empno, isbn, date )
Write the following queries in SQL:
? Print the names of employees who have borrowed any books published by McGraw-
Hill.
? Print the names of employees who have borrowed all books published by McGraw-
Hill.
? For each publishers, print the names of employees who have borrowed more than
five books of that publisher.

18. (a). Create a table as book (sl.no, book_name, author_name,price,


edition,publisher_name ).
Perform the following operations:
? Insert minimum ten tuples in book table
? Commit the table book
? Create a save point for the table book as B
? Rollback the table book after inserting 4 & 5 row
? Define Grant & Revoke
(b). Design an application for Library Management System and Show the database

connectivity details using suitable Front End Tool.

19. An Electricity Board charges the following rates to domestic users to


discourage large consumption of energy:
For the first 1 - 200 units? { 1 - 100 units = Rs. 1.00, 101 - 200 units =
Rs.1.50 }
From 201 - 500 units?{ 1 - 200 units = Rs. 2.00 and 201 - 500 units = Rs. 3.00 }
Above 500 units?{ 1 - 200 = Rs. 3.50, 201- 500 unit = Rs. 4.60 &above 500 unit
Rs.6.60}
Write a PL/SQL program to read the connection_id of users and number of units
consumed, display the charges with names.

20. Create a table salesman{ salesman_id, name, city, commission } and


customer{customer_id, name, city, grade, slaesman_id}. Write the following query:
? Create a view for those salesmen belongs to the city New York
? Create a view for all salesmen with columns salesman_id, name, and city
? Find the salesmen of the city New York who achieved the commission more than
13%.
? Create a view to getting a count of how many customers we have at each level
of a grade.

-----------------------------------------------------------------------------------
-----------------------------------------------
1. 1. Create a table �Student� with the following details (table level
constraints)
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference �Course� table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table �Course� with the following details (table level
constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don�t input values for total field
C. List the student names and their course names
D. Write a PL/SQL block to find whether the given number is odd or even
E. Write a database trigger before delete for each row on table course, delete
corresponding course students from Student table
F. Design and implement a student form to insert and edit the student details.

2. 1. Create a table �Employee� with the following details(Column level


constraints)
Empno Number(5) Primary key
Empname Varchar2(20) Designation Varchar2(10)
Date_of_join Date
Salary Number(9,2) NOT NULL
Depno Number(2) Foreign key(Reference �Department� table)
2. Create another table called �Department� with the following structure(Column
level constraints)
Depno Number(2) Primary key
Depname Varchar2(15)
Deplocation Varchar2(10)
A. Display the number of employees in each department with the department
numbers in descending order
B. List the departments where there are employees functioning
C. List the employees whose depno is not equal to �01�
D. Write a PL/SQL block to find the factorial of a number
E. Write a PL/SQL procedure which accepts depno as input and increase the salary
of the corresponding department employees by 5% in the employee table
F. Design and implement a employee form to display and delete the employee
details

3. 1. Create a table order_master with the following fields


Orderno varchar2(5) Ordate date
Vencode varchar2(5)
Ordstatus char(1) (p-pending,d-delivered)
Del_date Date
2. Create a table order_detail with the following fields
Orderno varchar2(5) Itemcode varchar2(5)
Qty_ord number(5) Qty_deld number(5)
A. Display the information on orders being handled by a vendor whose Vencode is
�V004� according to the delivery date order
B. List the orders which have been placed after �01-Jan-2006� and before �01-
Jul-2006�
C. List out the pending orders
D. Write a PL/SQL block to find whether the given year is leap year or not
E. Write a PL/SQL block to display a particular order details. Display
appropriate message if the order is not found.
F. Design and implement an order-master form to add and delete order details.

4. 1. Create a table �Student� with the following details (table level


constraints)
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference �Course� table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table �Course� with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don�t input values for total field.
C. List the student name with the highest mark1
D. Write a PL/SQL function to find the factorial of a given number
E. Write a database trigger to display the total number of records after
inserting a record into the table
F. Design and implement a course management system to add and delete courses.

5. 1. Create a table member with the following fields member code, member
name, phoneno.
2. Create a table book with the following fields bookcode, category code,
bookname, cost.
3. Create a table issue with the following fields membercode, Book code,
Issuedate, Returndate.
A. List all the members names who have taken the book on 8-10-2007.
B. List the member codes of the members who have taken books worth more than Rs.
400.00.
C. Write a PL/SQL block to generate the Fibonacci series
D. Write a PL/SQL block using cursor to display the contents of various tables
based on the options
E. Design and implement a book form to add and display details.

6. Create a table vendor_master with the following fields


Vencode varchar2(5) Venname varchar2(15)
Venadd1 varchar2(30) Venadd2 varchar2(30)
Venadd3 varchar2(30)
A. Change the address of the vendor with Vendor code �V002� in Vendor_master
B. Display the next occurrence of �Friday� to the current date.
C. Find the total number of vendors.
D. List the vendor names start with the letter �A�.
E. Write a PL/SQL block to find whether the given number is odd or even
F. Write a PL/SQL block using cursor to display the total number of records and
delete a record
G. Design and implement vendor-master system to add and display the details.

7. 1. Create a table �Student� with the following details (table level


constraints)
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference �Course� table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table �Course� with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. List the student names starting with the letter �S�.
C. Update the total field by adding Mark1 and Mark2
D. Write a PL/SQL block to find whether the given year is leap year or not
E. Write a PL/SQL block using cursor to display the student names and their
corresponding course names.
F. Design and implement a student form to insert and edit the student details.
8. 1. Create a table �Employee� with the following details(Column level
constraints)
Empno Number(5) Primary key
Empname Varchar2(20) Designation Varchar2(10)
Date_of_join Date
Salary Number(9,2) NOT NULL
Depno Number(2) Foreign key(Reference �Department� table)
2. Create another table called �Department� with the following structure(Column
level constraints)
Depno Number(2) Primary key
Depname Varchar2(15)
Deplocation Varchar2(10)
A. Display the number of employees in each department with the department
numbers in descending order
B. Display designation, department no and total number of employees designation
wise and department wise.
C. List the Employee names and their department names.(Use Outer join)
D. Write a PL/SQL block to find whether the given number is odd or even
E. Write a database trigger before insert or update for each row on the table
employee not allowing to enter salary > 25,000
F. Design and implement a employee form to display and delete the employee
details.

9. Create a table itemfile with the following fields


Itemcode varchar2(5) Itemdesc varchar2(30)
P_category varchar2(30) (Spares, Accessories)
Qty_hand number(5) Re_level number(5)
Maxlevel number(5) Itemrate number(9,2)
A. Display the quantity required (maxlevel � Qtyhand) of each item under the
category of spares to reach the maximum level
B. Find the item with maximum rate in each product category
C. Find the items whose quantity in hand is less than the maximum level for the
�spares� category
D. Find the total number of items under �Accessories� category.
E. Write a PL/SQL block to find whether the given year is leap year or not
F. Write a PL/SQL block to display a particular item details. Display
appropriate message if the item is not found
G. Design and implement item file management form to display and delete the item
details.

10. 1. Create a table member with the following fields member code, member
name, phoneno.
2. Create a table book with the following fields bookcode, category code,
bookname, cost.
3. Create a table issue with the following fields membercode, Book code,
Issuedate, Returndate.
A. List all the members names who have taken the book on 8-10-2007.
B. Find the total cost of books category wise.
C. Write a PL/SQL block to find whether the given number is odd or even.
D. Write a PL/SQL block to display a particular book details. Display
appropriate message if the book is not found.
E. Design and implement a book store system to add and display book details.

11. 1. Create a table �Student� with the following details (table level
constraints)
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference �Course� table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table �Course� with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don�t input values for total field.
C. List the student names and their course names
D. Write a PL/SQL block to find the sum of �n� natural numbers
E. Write a PL/SQL cursor to display the student details
F. Design and implement course management form to add and edit the details.

12. 1. Create a table �Student� with the following details (table level
constraints)
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference �Course� table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table �Course� with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don�t input values for total field
C. List the student names and their course names.
D. Write a database trigger to display the total number of records after
inserting a recordinto the table
E. Write a PL/SQL function to display the Fibonacci series.
F. Design and implement a student form to insert and edit the student details.

13. Create a table vendor_master with the following fields


Vencode varchar2(5) Venname varchar2(15)
Venadd1 varchar2(30) Venadd2 varchar2(30)
Venadd3 varchar2(30)
A. Modify the existing column Venname from varchar2(15) to varchar2(25)
B. Delete the table Vendor_master
C. Find the total number of vendors.
D. Display the vendor names in descending order.
E. Write a PL/SQL block using cursor to display the total number of records and
delete a record.
F. Write a PL/SQL function to find the factorial of a given number.
G. Design and implement vendor-master system to edit and display the details.

14. 1. Create a table order_master with the following fields


Orderno varchar2(5) Ordate date
Vencode varchar2(5)
Ordstatus char(1) (p-pending,d-delivered)
Del_date Date
2. Create a table order_detail with the following fields
Orderno varchar2(5) Itemcode varchar2(5)
Qty_ord number(5) Qty_deld number(5)
A. Display the information on orders being handled by a vendor whose Vencode is
�V004� according to the delivery date order
B. List the orders which have been placed after �01-Jan-2018� and before �01-
Jul-2018�.
C. List out the pending orders
D. Write a PL/SQL block to find the sum of �n� natural numbers
E. Write a PL/SQL block using cursor to display the contents of various tables
based on the options
F. Design and implement an order-delivery system form to add and delete order
delivery details.

15. 1. Create a table �Employee� with the following details(Column level


constraints)
Empno Number(5) Primary key
Empname Varchar2(20) Designation Varchar2(10)
Date_of_join Date
Salary Number(9,2) NOT NULL
Depno Number(2) Foreign key(Reference �Department� table)
2. Create another table called �Department� with the following structure(Column
level constraints)
Depno Number(2) Primary key
Depname Varchar2(15)
Deplocation Varchar2(10)

A. List the employees whose depno is not equal to �01�


B. Display designation, department no and total number of employees designation
wise and department wise
C. List the Employee names and their department names.(Use Outer join)
D. Write a PL/SQL block to find the factorial of a given number
E. Write a PL/SQL procedure which accepts depno as input and increase the salary
of the corresponding department employees by 10% in the employee table.
F. Design and implement a employee form to display and delete the employee
details

16. 1. Create a table member with the following fields member code, member
name, phoneno.
2. Create a table book with the following fields bookcode, category code,
bookname, cost.
3. Create a table issue with the following fields membercode, Book code,
Issuedate, Returndate.
A. List all the members names who have taken the book on 8-10-2007.
B. List the member codes of the members who have taken books worth more than Rs.
400.00.
C. Write a PL/SQL block to generate the Fibonacci series
D. Write a database trigger to display the total number of members after
inserting a record into the member table
E. Design and implement a book form to add and delete book details

Itemcode varchar2(5) Itemdesc varchar2(30)


P_category varchar2(30) (Spares, Accessories)
Qty_hand number(5) Re_level number(5)
Maxlevel number(5) Itemrate number(9,2)
A. Find the item with maximum rate in each product category
B. Find the items whose quantity in hand is less than the maximum level for the
�spares� category
C. List the accessories items having item rate greater than the minimum item
rate of �spares� category.
D. List the items that are available more than 100 in quantity.
E. Write a database trigger to display the total number of records after
inserting a record into the table
F. Write a PL/SQL function to display the Fibonacci series
G. Design and implement item file management form to display and delete the item
details.

18. 1. Create a table order_master with the following fields


Orderno varchar2(5) Ordate date
Vencode varchar2(5)
Ordstatus char(1) (p-pending,d-delivered)
Del_date Date
2. Create a table order_detail with the following fields
Orderno varchar2(5) Itemcode varchar2(5)
Qty_ord number(5) Qty_deld number(5)
A. Display the information on orders being handled by a vendor whose Vencode is
�V004� according to the delivery date order
B. List the orders which have been placed after �01-Jan-2018� and before �01-
Jul-2018�
C. Delete the orders having order status delivered.
D. Write a PL/SQL block to find whether the given year is leap year or not
E. Write a PL/SQL block using cursor to display the orders placed in a
particular date.
F. Design and implement an order master form to add and delete order details.

19. 1. Create a table �Student� with the following details (table level
constraints)
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference �Course� table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table �Course� with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don�t input values for total field
C. List the student names and their course names.
D. Write a PL/SQL block to display the Fibonacci series
E. Write a PL/SQL block using cursor to update the total field
F. Design and implement a student form to insert and edit the student details.

20. 1. Create a table �Employee� with the following details(Column level


constraints)
Empno Number(5) Primary key
Empname Varchar2(20) Designation Varchar2(10)
Date_of_join Date
Salary Number(9,2) NOT NULL
Depno Number(2) Foreign key(Reference �Department� table)
2. Create another table called �Department� with the following structure(Column
level constraints)
Depno Number(2) Primary key
Depname Varchar2(15)
Deplocation Varchar2(10)
A. Display the number of employees in each department with the department
numbers in descending order
B. List the departments where there are employees functioning
C. Display the employee names and their years of service
D. Write a PL/SQL procedure which accepts depno as input and increase the salary
of the corresponding department employees by 10% in the employee table.
E. Write a PL/SQL function to count the number of employees in a particular
department
F. Design and implement a department form to display and delete the department
details

You might also like