Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Page 1 of 7

B.E / B.Tech / B.Arch PRACTICAL END SEMESTER EXAMINATIONS, AUGUST 2021


Fourth Semester

CS8481 & DATA BASE MANAGEMENT SYSTEMS LABORATORY

(Regulations 2017)

Time : 3 Hours Max. Marks 100

Date: 6.8.2021(AN)

AIM & QUERIES & OUTPUT &


MCQ VIVA RECORD TOTAL
PROCEDURE PROGRAM RESULT

20 35 10 15 10 10 100

211419104301 Create a Table as workers and the details are { S.No, Name, Designation, Branch }
Perform the following commands:
i. Alter the table by adding a column Salary
ii. Alter the table by modifying the column Name
iii. Describe the table employee
iv. Copy the table employee as emp
v. Truncate the table
vi. Delete the Second row from the table
vii. Drop the table.

211419104302 Create the following tables


student_details {register_no, student_name, DOB, address, city}
mark_details {register_no, mark1, mark2, mark3, total }
i. Display only those rows whose total ranges between 250 and 300.
ii. Drop the table mark_details and Delete the row whose register_no=161.
iii. Display all details whose names begins with 'a'.
iv. Write a PL/SQL program to print the details of the student when regno is given as input.

211419104303 Consider the following relational schema for a Loan database application:
Customer {Customer_id, Customer_name, Age, phone_no}
Loan { Loan_id, Amount, Customer_id)}
i. Include the constraint on Loan_id that it starts with letter ‘L’.
ii. Display the list of the customer_ids and total Loan amount taken.
iii. Display the Customer_id and Customer_name who have taken less than two loans
v. Write a PL/SQL program to print the details of the customer when customerid is given as
input.

211419104304 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}
Page 2 of 7

Borrower { customer_name, loan_number)}


i. Create the above tables by properly specifying the primary keys and foreign keys and
enter at least five tuples for each relation.
ii. Find all the customers who have at least two accounts at the main branch.
iii. Find all the customers who have an account at all the branches located in a specific
city.
iv. Write a PL/SQL program to delete all account tuples at every branch located in a
specific city.
211419104305 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)
i. Display the total number of girls and boys hostel in the college.
ii. Display the menu in the hostel ‘x’ on Tuesday.
iii. Display the number of wardens for each hostel.II.

211419104306 Create an Employee table with an attributes { empid, empname, department designation,
Gross_salary .
i.
ii. i.Using cursor, select the five highest paid employees from the Employee table.
ii.Write a trigger which displays the employee details whenever the values are inserted in the
respective table.

211419104307 Consider a database used to record the marks that students get in different exams of different
courses offerings.
i. i.Construct an ER diagram that models exams as entites, and uses a ternary
relationship, for the database.
ii. Ii.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.

211419104308 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)
a) Find all employees in the database who earn more than each employee of Small Bank
Corporation.
b) Assume that the companies may be located in several cities. Find all companies
located in every city in which Small Bank Corporation is located.
c) 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.
211419104309 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:
a) Print the names of employees who have borrowed any books published by McGraw-
Hill.
Page 3 of 7

b) Print the names of employees who have borrowed all books published by McGraw-
Hill.
c) For each publishers, print the names of employees who have borrowed more than five
books of that publisher.
211419104310 1. Create a table as book (sl.no, book_name, author_name,price, edition,publisher_name ).
Perform the following operations:
a) Insert minimum ten tuples in book table
b) Commit the table book
c) Create a save point for the table book as B
d) Rollback the table book after inserting 4 & 5 row
e) Define Grant & Revoke
2. Design an application for Library Management System and Show the database
connectivity details using suitable Front End Tool.

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

211419104312 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. .
211419104313 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.
Create the following tables with the mapping given below.
211419104314
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.
Create the following tables with the mapping given below.
211419104315
Employee (Empno, Ename, Job, MgrId, DoB, DoJ, Sal, Comm, Deptno)
Page 4 of 7

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
211419104316 Write the Query statement for the following
a. Create a Student table (Regno, name, dept) and populate with data.
b. Create a view for CSE dept with the details of students of CSE dept.

c. Implement TCL commands with student table.

d.Write a PL/SQL program to find the details of the student when regno is given as
input.

211419104317
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.
.
211419104318 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 .
211419104319
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.
Page 5 of 7

iv. Develop PL/SQL Cursor that selects marks of a particular student in a specified semester.

211419104320 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.

211419104321
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.

211419104322 .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.

211419104323
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 fund amount spent by the administration
department

211419104324
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.
Page 6 of 7

ii. Display all dept_name along withdept_no.


iii. Drop the table dept_details.
v. Write a PL/SQL Trigger to verify the data before insertion on assessment table.

211419104325
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

211419104326. 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.

211419104327
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

211419104501 Consider a database used to record the marks that students get in different exams of different
courses offerings.
i.Construct an ER diagram that models exams as entites, and uses a ternary relationship, for
the database.
ii.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.

211417104277
Create a database for Placement and Training cell.
Stud_details(regno, name, dept, percentage)
Company(companyID,name, noOfVacancy)
Training_Details(CourseID, name, Trainer)
Page 7 of 7

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.

Internal Examiner External Examiner

You might also like