DBMS Updated Program List
DBMS Updated Program List
2: Draw an ER for Company database with atleast 4 entities and convert them into tables.
Perform DDL on Above converted tables.
1. Create tables with all constraints
2. create views on any two tables using conditions
3. create index called EmployeeId for the department table. Entries should be in
ascending order by department id and then by employee id within each department.
4. create sequence on Employee id.
3: write a trigger for Library (bid, bname, doi, status) to update the number of copies
(noc) according to ISSUE & RETURN status on update or insert query. Increase the noc
if status is RETURN, Decrease noc if status is ISSUE in Library_Audit
table(bid,bname,noc,timestampofquery). Write a trigger after update on Library such
that if doi is more than 20 days ago then status should be FINE and in the Library_Audit
table fine should be equal to no. of days * 10.
4: Write a database trigger on Library table. The System should keep track of the records
that are being updated or deleted. The old value of updated or deleted records should be
added in Library_Audit table.
5.Write PL/SQL Procedure to find the population density of the cities. If the population
density is above 3000 then Type of city must be entered as High Density in Category
table. Between 2999 to 1000 as Moderate and below 999 as Low Density. Error must be
displayed for population less than 10 or greater than 25718.
6: Write PL/SQL Procedure to find class [Distinction (Total marks from 1499 to
990) ,First Class( 899 to 900) Higher Second (899 to 825) ,Second,Pass (824 to 750) ] of
a student based on total marks from table Student (rollno, name, Marks1, Marks2,
Marks3, Marks4, Marks5).
8 Draw ER for Library database with atleast 5 entities and convert them into tables.
Perform DDL on above converted tables.
1. Create tables with all constraints (Based on ER diagram cardinalities)
2. Create views on any two tables using join condition
3. Create index called Lib_Index1. Entries should be in ascending order by Author name.
4. Create sequence on Bookid.
9: Implement SQL DDL statements which demonstrate the use of SQL objects such as
Table, View, Index, Sequence for following relational schema:
Borrower(Rollin, Name, DateofIssue, NameofBook, Status)
10 PL/SQL code block: Use of Control structure and Exception handling is mandatory.
Write a PL/SQL block of code for the following requirements:-
Schema:
1. Borrower(Rollin, Name, DateofIssue, NameofBook, Status)
2. Fine(Roll_no,Date,Amt)
3. Library (bid, bname, doi, status,noc)
4. transaction (tid,bid, bname, status)
1. Accept roll_no & name of book from user.
2. Check the number of days (from date of issue), if days are between 15 to 30 then
fine amount will be Rs 5per day.
3. If no. of days>30, per day fine will be Rs 50 per day & for days less than 30, Rs. 5
per day.
4. After submitting the book, status will change from I to R.
5. Update the noc in library according to the transaction made. Increase the noc if
status is RETURN, Decrease noc if status is ISSUE.
6. If condition of fine is true, then details will be stored into fine table.
11 Implement SQL DDL statements which demonstrate the use of SQL objects such as
Table, View, Index, Sequence for following relational schema:
12. Design at least 10 SQL queries for suitable database application using SQL DML
statements: all types of Join, Sub-Query and View.
13 Implement all SQL DML opeartions with operators, functions, and set operator for
given schema:
Account(Acc_no, branch_name,balance)
branch(branch_name,branch_city,assets)
customer(cust_name,cust_street,cust_city)
Depositor(cust_name,acc_no)
Loan(loan_no,branch_name,amount)
Borrower(cust_name,loan_no)
Students(stud_id, stud_name,stud_addr,stud_marks)
15 Implement all SQL DML opeartions with operators, functions, and set operator for
given schema:
Account(Acc_no, branch_name,balance)
branch(branch_name,branch_city,assets)
customer(cust_name,cust_street,cust_city)
Depositor(cust_name,acc_no)
Loan(loan_no,branch_name,amount)
Borrower(cust_name,loan_no)
Create above tables with appropriate constraints like primary key, foreign key,
check constrains, not null etc.
16:Implement all SQL DML opeartions with operators, functions, and set operator for
given schema:
Account(Acc_no, branch_name,balance)
branch(branch_name,branch_city,assets)
customer(cust_name,cust_street,cust_city)
Depositor(cust_name,acc_no)
Loan(loan_no,branch_name,amount)
Borrower(cust_name,loan_no)
Create above tables with appropriate constraints like primary key, foreign key, check
constrains, not null etc.Solve following query:
17 :Implement all SQL DML operations with operators, functions, and set operator for
given schema:
Account(Acc_no, branch_name,balance)
branch(branch_name,branch_city,assets)
customer(cust_name,cust_street,cust_city)
Depositor(cust_name,acc_no)
Loan(loan_no,branch_name,amount)
Borrower(cust_name,loan_no)
AND
Write a PL/SQL code to calculate total and percentage of marks of the students in four
subjects.
Add primary key and foreign key wherever applicable. Insert data into the above created
tables.
1. Display customer name having living city Bombay and branch city Nagpur
2. Display customer name having same living city as their branch city
3. Display customer name who are borrowers as well as depositors and having living
city Nagpur.
21. Create following collection and using MongoDB implement all CRUD operations.
25. Writ a PL/SQL procedure to find the number of students ranging from 100-70%, 69-
60%, 59-50% & below 49% in each course from the student_course table given by the
procedure as parameter.
Schema: Student (ROLL_NO ,COURSE, COURSE_COD ,SEM ,TOTAL_MARKS,
PERCENTAGE)
26. Write a Stored Procedure namely proc_Grade for the categorization of student. If
marks scored by students in examination is <=1500 and marks>=990 then student will be
placed in distinction category if marks scored are between 989 and 900 category is first
class, if marks 899 and 825 category is Higher Second Class.
27.Create
database :Citydetails(_id,name,area,population(total,Adults,seniorcitizens,sexratio),
geography(avgtemp, avgrainfall, longitude, latitude))