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

DBMS PDF Solutions

The document outlines a list of experiments for a database management systems lab. It includes creating database schemas and tables for various scenarios like customer-sales, students-library, employees-pay, and performing queries, views and stored procedures/functions on the tables.

Uploaded by

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

DBMS PDF Solutions

The document outlines a list of experiments for a database management systems lab. It includes creating database schemas and tables for various scenarios like customer-sales, students-library, employees-pay, and performing queries, views and stored procedures/functions on the tables.

Uploaded by

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

Vidya Jyothi Institute of Technology

Department of Computer Science and Engineering


II year II sem

Data Base Management Systems Lab


LIST OF EXPERIMENTS

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.
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
e. List the details of the customer who have bought a product which has a
price>200.
f. Give a count of how many products have been bought by each customer
g. Give a list of products bought by a customer having cust_id as5.
h. List the item details which are sold as of today
i. Create a view which lists out the bill_no, bill_date, cust_id, item_id, price,
qty_sold, amount.
j. Create a view which lists the daily sales date wise for the last oneweek

2. 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 integrityconstraints.
b. Insert around 10 records in each of thetables.
c. List all the student names with their membershipnumbers
d. List all the issues for the current date with student and Booknames
e. List the details of students who borrowed book whose author is KORTH.
f. Give a count of how many books have been bought by eachstudent.
g. Give a list of books taken by student with stud_no as 5.
h. List the book details which are issued as oftoday.
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
3. Database Schema for a Employee-payscenario
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 integrityconstraints.
b. Insert around 10 records in each of thetables.
c. List the employee details departmentwise.
d. List all the employee names who joined after particular date.
e. List the details of employees whose basic salary is between 50,000 and 1,00,000
f. Give a count of how many employees are working in eachdepartment.
g. Give a name of the employees whose net salary>1,00,000.
h. List the details for an employee_id=5
i. Create a view which lists out the emp_name, department, basic, deductions, net
salary.
j. Create a view which lists the emp_name and his net salary.

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.
a. Create the tables with the appropriate integrity constraints
b. Insert around 10 records in each of thetables.
c. List all the customer names with their membershipnumbers
d. List all the issues for the current date with the customer names and cassette
names
e. List the details of the customer who has borrowed the cassette whose title is
―The Legend‖
f. Give a count of how many cassettes have been borrowed by eachcustomer.
g. Give a list of cassettes which has been taken by the Customer with mem_no as 5
h. List the cassettes issues for today.
i. Create a view which lists outs the iss_no, iss_date, cust_name,cass_name
j. Create a view which lists issues-date wise for the last one week

5. 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, day of week: string)
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
d. List the total number of lab allotments daywise.
e. Give a count of how many machines have been allocated to the ‘CSE‘ class
f. Give a machine allotment details of the stud_no 5 with his personal and class
details.
g. Count for how many machines have been allocated in Lab_no 1 for the day of
the week as ―Monday‖
h. How many students class wise have allocated machines in thelabs.
i. Create a view which lists out the stud_no, stud_name, mach_no, lab_no,day of
week.
j. Create a view which lists the machine allotment details for―Thursday.

6. Create a procedure to find reverse of a given number.

7. Create a procedure to update the salaries of all employees as per the given data.

8. Create a procedure to demonstrate IN, OUT and INOUT parameters.

9. Create a function to check whether given string is palindrome or not.

10. Create a function to find sum of salaries of all employees working in depart
number 10.

11. Create a trigger before/after update on employee table for each row/statement.

12. Create a trigger before/after delete on employee table for each row/statement.

13. Create a trigger before/after insert on employee table for each row/statement.

You might also like