Dbms Lab Practical 2018

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

1. Create the following tables with the mapping given below.

a. stu_details(reg_no, stu_name, DOB, address, city)


b. mark_details(reg_no, mark1, mark2, mark3, total)
(i) Alter the table mark_details to add a column average with data type as long.
(ii) Display the months between the DOB and till date.
(iii) Using alter command drop the column address from the table stu_details.
(iv) Write a PL/SQL program to find the sum &avg marks of all the student using
procedures.
(v)Establish a connection between SQL and python and perform Insert ,update operation in
Banking application
Creation Queries PL/SQL /
PL/SQL (20) Viva-voce (10) Total (100)
&Insertion (20) (30) PYTHON(20)

2. Create the following tables with the mapping given below.


a. emp_details(emp_no, emp_name, DOB, address, doj, mobile_no, dept_no, salary).
b. dept_details(dept_no, dept_name, location).
(i) Display the months between the doj and till date.
(ii) Alter the table emp_details to add a primary key constraint on emp_no.
(iii)Write a pl/sql program to display the salary of a particular employee using functions.
(iv) Establish a connection between SQL and python and perform Insert, delete operation
in Library Management System
Creation Queries PL/SQL /
PL/SQL (20) Viva-voce (10) Total (100)
&Insertion (20) (30) PYTHON(20)

3. Create the following tables with the mapping given below.


a. stu_details(reg_no, stu_name, DOB, address, city)
b. mark_details(reg_no, mark1, mark2, mark3, total)
(i). Display only those rows whose total ranges between 250 and 300.
(ii). Drop the table mark_details.
(iii). Delete the row whose reg_no=161.
(iv). Display all details whose names begins with 'a'.
(v).Write a pl/sql program to Update the salary of a particular employee using Trigger.
(vi) Establish a connection between SQL and python and perform Insert, fetch operation in
Employee
Management system
Creation Queries
PL/SQL (40) Viva-voce (10) Total (100)
&Insertion (20) (30)

4.Create the following tables with the mapping given below.


a. emp_details(emp_no, emp_name, DOB, address, doj, mobile_no, dept_no, salary).
b. dept_details(dept_no, dept_name, location).
(i) Truncate the table dept_details.
(ii) Display the structure of the table emp_details.
(iii) Convert the first letter of emp_name into capitals.
(iv) Display the emp_namegetting highest salary.
(v)Design a application for Banking Process using python.

Creation PL/SQL /
Queries (40) Viva-voce (10) Total (100)
&Insertion (20) PYTHON(20)

5. Create the following tables with the mapping given below.


a. book (book_name,author,price,quantity).
b. customer (Cust_id, Cust_name, Addr, ph_no,pan_no)
(i) Truncate the table customer.
(ii) List the author of the book which one have the price of 200.
(iii).List the price of the book which one is between the price of 175 & 250.
(iv).Retrieve all the details from the table book whose author name start with K.
(v) Write a pl/sql program to find the largest of two numbers.
(vi) Write a pl/sql program to Update the price of a particular book using Trigger.
Creation
Queries (40) PL/SQL (20) Viva-voce (10) Total (100)
&Insertion (30)

6. Create the following tables with the mapping given below.


a. stu_details(reg_no, stu_name, DOB, address, city)
b. mark_details(reg_no, mark1, mark2, mark3, total)
(i)Find out the name of all students.
(ii)List all the student detail that who are all located in Chennai.
(iii) Drop the table mark_details.
(iv)Write a pl/sqlprogram to find the address of a particular student using functions.
(v) ) Establish a connection between SQL and python and perform Insert, fetch operation
in hotel
Management system

Creation Queries PL/SQL /


PL/SQL (20) Viva-voce (10) Total (100)
&Insertion (20) (30) PYTHON(20)

7. Create the following tables with the mapping given below.


a. Customer (Cust_id, Cust_name, Addr, ph_no,pan_no)
b. Loan (Loan_id, Amount, Interest, Cust_id)
c.Account(account_no,customer_id,balance)
(i)Display the Cust_name having both Loan and Account .
(ii) Display number of Loans, the sum of Loan Amount of a
ParticularCustname(“LEENA”)
(iii)Display the Custname doesn’t hold any Account nor taken any Loan
(iv)Add a column nol(number of loans)
(v) Establish a connection between SQL and python and perform Insert, update and delete
operation in banking application from the above table.

Creation Queries PL/SQL /


PL/SQL (20) Viva-voce (10) Total (100)
&Insertion (20) (30) PYTHON(20)
8. Create the following tables with the mapping given below.
a. emp_details(emp_no, emp_name, DOB, address, doj, mobile_no, dept_no, salary).
b. dept_details(dept_no, dept_name, location).
(i)Select dept_no from dept_details and not in emp_details using both the tables.
(ii) Create a table named as student and insert values into the table.
(iii) Write a pl/sql program to display the salary of a particular employee using functions.
(iv)Write PL/SQL Program to generate even numbers.

Creation Queries PL/SQL /


PL/SQL (20) Viva-voce (10) Total (100)
&Insertion (20) (30) PYTHON(20)

9. Create the following tables with the mapping given below.


Phone_book(ph_no,name,door_no,street,place).
(i)Display all names along withph_no.
(ii)Add a column pin_no.
(iii)Write a pl/sql program to find the address of a particular customer using functions.
(iv)Write a pl/sql program to find the factorial of a given number using functions.
(v)Establish a connection between SQL and python and perform Insert, update and delete
operation in railway reservation application.

Creation Queries PL/SQL /


PL/SQL (20) Viva-voce (10) Total (100)
&Insertion (20) (30) PYTHON(20)

10. a. 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. Create the above tables by properly specifying 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 12 to 25000.

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
2008.
v. Find the number of accidents in which cars belonging to a specific model were involved.
b. Write a PL/SQL to find and display the sum of first n natural numbers.

Creation Queries PL/SQL Viva-voce


Total (100)
&Insertion (20) (50) (20) (10)

You might also like