Professional Documents
Culture Documents
T Date: 6.8.2021 (AN) : Fourth Semester
T Date: 6.8.2021 (AN) : Fourth Semester
(Regulations 2017)
Date: 6.8.2021(AN)
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.
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.
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
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.
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
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
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.