CSL 333 Database Management Systems Lab Cycle
CSL 333 Database Management Systems Lab Cycle
CSL 333 Database Management Systems Lab Cycle
1
Creation of database schema - DDL (create tables, set constraints, enforce relationships, create
indices, delete and modify tables).
Design a database schema for an application with ER diagram from bank databases. *
1. Branch<branch name(pk),branch city(unique),assets>
2. customer<cu_no(pk),cu_name(not null), cu_street,cu_city>
3. loan<loan number(pk), branch name(fk),amount(not null)>
4. Borrower<cu_no(fk),loan_no(fk)>
5. Account <ac_no(pk),br_name,balance(not null)>
6. depositor<cu_no(fk),ac_no(fk)>
2
Practice SQL commands for DML (insertion, updating, altering, deletion of data, and
viewing/querying records based on condition in databases)
3
Design a normalized database schema with ER diagram for the following requirement.
The requirement: A library wants to maintain the record of books, members, book issue, book
return, and fines collected for late returns, in a database. The database can be loaded with book
information. Students can register with the library to be a member. Books can be issued to
students with a valid library membership. A student can keep an issued book with him/her for a
maximum period of two weeks from the date of issue, beyond which a fine will be charged.
Fine is calculated based on the delay in days of return. For 0-7 days: Rs 10, For 7 – 30 days: Rs
100, and for days above 30 days: Rs 10 will be charged per day
4 Implementation of Build in functions in RDBMS (string,numeric,date and time)
INVENTORY(Stores name, price, model, year of manufacturing, fuel type)
CUSTOMER:(customer Id, name, address, phone number , email )
SALE:((invoice number, car Id, customer id, sale date, mode of payment, sales person’s
employee Id, and selling price )---of the car sold,
EMPLOYEE(employee Id, name, date of birth, date of joining, designation, salary )…of
each employee in the showroom.
A. Calculate GST as 12% of Price and display the result after rounding it off to one
decimal place.
B. Add a new column FinalPrice to the table inventory, which will have the value as sum
of Price and 12% of the GST.
C. Calculate and display the amount to be paid each month (in multiples of 1000) which is
to be calculated after dividing the FinalPrice of the car into 10 instalments.
D. d) After dividing the amount into EMIs, find out the remaining amount to be paid
immediately, by performing modular division. Following SQL query can be used to
solve the above mentioned problems:
E. Add a new column Commission to the SALE table. The column Commission should
have a total length of 7 in which 2 decimal places to be there.
F. calculate commission for sales agents as 12 per cent of the SalePrice, insert the values
to the newly added column Commission and then display records of the table SALE
where commission > 73000
G. Display customer name in lower case and customer email in upper case from table
CUSTOMER
H. Display emails after removing the domain name extension “.com” from emails of the
customers.
I. Display details of all the customers having yahoo emails only
J. Select the day, month number and year of joining of all employees.
SECOND CYCLE
LAB 3
6 Implementation of Order By, Group By& Having clause. *
A. display minimum & maximum age of employees for each department[emp table]
B. display department vice average salary of employees whose average salary is greater
than 40,000.[emp table]
C. Display the number of cars purchased by each customer from the SALE table.
D. Display the customer Id and number of cars purchased if the customer purchased more
than 1 car from SALE table
E. Display the number of people in each category of payment mode from the table SALE.
F. Display the PaymentMode and number of payments made using that mode more than
once
MINIPROJECT PHASE 2
LAB 4
B. Create a database procedure to add, update and delete a book to the Library database
(use parameters).
LAB 8
16 Creation of database Triggers and Cursors *
A. Implement a triggers to implement admission of the college
1. Close the admission of college after ’31-July-2015’
2. Update the number of vacancies after insertion/updation in the admission table
College_vacancies(deptname,totalseats,admitted,vacancy)
admission(branch,sid,sname,Dob,Address,m_phy,m_che,m_bio_com,m_maths,m_t
ot)
B. Create a history table (you may use the same structure without any keys) for the
MEMBER table and copy the original values of the row being updated to the history
table using a TRIGGER.
LAB 9
17
A. Use cursors and create a procedure to print Books Issue Register
B. PL/SQL program to calculate total marks of each student using Cursor
(s_no,s_name,dept_name,maths,os,dbms,total(initially empty))
MINIPROJECT PHASE 3
LAB 10
18 Creation of Packages
19 Creation of PL/SQL blocks for exception handling
LAB 11
20 Familiarization of NoSQL Databases and CRUD operations
21 Mini project final
Design a database application using any front end tool for any problem selected. The
application constructed should have five or more tables
Integration of modules
MINIPROJECT PHASE 1 …Coding of module 1
MINIPROJECT PHASE 2…..Coding of module 2
MINIPROJECT PHASE 3 …… Coding of module 3