Lab Course-II Slips
Lab Course-II Slips
B) Write a cursor to update the income of all people living in ‘Urban’ area by 10%
(Marks 15)
*Note: Input data for the query should be specified by the examiner.
Slip 1
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
B) Write a stored function using cursors to display the names of actors who have acted in
the maximum number of movies. (Marks
15)
*Note: Input data for the query should be specified by the examiner.
Slip 2
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
B) Write a cursor to print the total number of distinct customers along with their loan
approved amount. (Marks 15)
*Note: Input data for the query should be specified by the examiner.
Slip 3
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
B) Write a cursor to accept the student name from the user & display student number, class
& address. (Marks 15)
*Note: Input data for the query should be specified by the examiner.
Slip 4
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
B) Write a stored function using cursors to find the list of employees whose joining date is
__________ . (Marks 15)
*Note: Input data for the query should be specified by the examiner.
Slip 5
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
Consider the following Business trip database that keeps track of the business
trips of salesman in an office.
Salesman (sno integer, s_name char (30), start_year integer, deptno Varchar (10))
Trip (tno integer, from_city char (20), to_city char (20),departure_date date,return_date
date)
Dept (deptno varchar (10), dept_name char(20))
Expense (eid integer, amount money)
Dept-Salesman : 1 to M
Salesman - Trip : 1 to M
Trip - Eexpense : 1 to 1
Create the above database in PostGreSQL. (Marks 5)
B) Write a cursor to list all salesman’s name, his trip details & expenses.
(Marks 15)
*Note: Input data for the query should be specified by the examiner.
B) Write a stored function using cursors to accept a city from the user and list all
warehouses in that city. (Marks 15)
*Note: Input data for the query should be specified by the examiner.
B) Write a stored function using cursors to find the confirmed bookings of all the trains on
________. (Marks 15)
*Note: Input data for the query should be specified by the examiner.
B) Write a stored function using cursors to display the details of a driver. (Accept
driver name as input parameter). (Marks 15)
*Note: Input data for the query should be specified by the examiner.
B) Write a stored function using cursors to print the total number of investors of a
company. (Accept company name as input parameter).
(Marks 15)
C) Create a view to display the (Marks 10)
1) Details of all the company in city _________.
2) Names of companies whose share_value >_______.
*Note: Input data for the query should be specified by the examiner.
B) Write a stored function using cursors to accept an address from the user & display the
name, subject & the marks of the student staying at that address.
(Marks 15)
Slip 11
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
40 marks.
*Note: Input data for the query should be specified by the examiner.
Slip 12
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
B) Write a cursor todisplay total daily-required count of newspapers for every language .
(Marks
15)
*Note: Input data for the query should be specified by the examiner.
Slip 13
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
C) Write a cursor to calculate item wise total quantity supplied by each supplier.
(Marks 15)
*Note: Input data for the query should be specified by the examiner.
Slip 14
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
B) Write a trigger which will prevent deleting persons from area _____. (Marks 15)
D) Write a function to count the people who are born on_______. (Marks 10)
*Note: Input data for the query should be specified by the examiner.
Slip 15
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
B) Write a stored function to accept producer name as input and print the names
of movies produced by him/her.. Also print the total number of actors in that
movie. Raise an exception for an invalid producer name.
(Marks 15)
*Note: Input data for the query should be specified by the examiner.
Slip 16
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
Consider the following Bank database which maintains information about its
branches, customers and their loan applications.
Branch (bid integer, brname char (30), brcity char (10))
Customer (cno integer, cname char (20), caddr char (35), city char(20))
Loan_application (lno integer, lamtrequire money, lamtapproved Money, l_date date)
Branch, customer, loan_application are related with ternary relationship.
Ternary (bid integer, cno integer, lno integer).
B) Write a trigger to validate the loan approved amount must be less than the loan
required amount. (Marks 15)
C) Write a function to count the number of customers of particular branch. (Accept branch
name as input parameter) (Marks 10)
Q.2) Project Viva (External) (Marks 25)
*Note: Input data for the query should be specified by the examiner.
Slip 17
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
B) Write a trigger before inserting into a teacher table to check experience. Experience
should be minimum 2 years. Display appropriate message. (Marks 15)
C) Write a function to list the names of the teachers who are teaching to a student named
“________”. (Marks 10)
*Note: Input data for the query should be specified by the examiner.
Slip 18
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
B) Write a trigger before insert / update on project table which checks that
no_of_hours_worked > 0. (Marks
15)
C) Write a function to get employee number who works on at least one project that
employee number ‘2000’ works on. (Marks 10)
Slip 19
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
*Note: Input data for the query should be specified by the examiner.
Consider the following Business trip database that keeps track of the business
trips of salesman in an office.
Salesman (sno integer, s_name char (30), start_year integer, deptno Varchar (10))
Trip (tno integer, from_city char (20), to_city char (20), departure_date date, return_date
date)
Dept (deptno varchar (10), dept_name char(20))
Expense (eid integer, amount money)
Dept-Salesman : 1 to M
Salesman - Trip : 1 to M
Trip - Eexpense : 1 to 1
B) Write a stored function to accept department name as input and print the
names of salesmen working in the department. Also print the total number of
trips of those salesmen. Raise an exception for an invalid department name.
(Marks 15)
C) Write a function to list the salesman numbers and names who made trips to Calcutta.
(Marks 10)
*Note: Input data for the query should be specified by the examiner.
B) Write a trigger that will prevent deletion of cities from state ‘Maharashtra’.
(Marks 15)
C) Write a function to list the names of stores of ‘Spares’ warehouse located at Pune.
(Marks 10)
Slip 21
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
*Note: Input data for the query should be specified by the examiner.
Q.1) Practical Question on PostGreSQL (Total Marks 40)
B) Write a trigger to validate train arrival time must be less than train departure time.
(Marks 15)
C) Write a function which accepts train name & date as input parameter & calculate total
ticket amount for that train on the given date.
(Marks 10)
*Note: Input data for the query should be specified by the examiner.
B) Define a trigger after insert or update the record of driver if the age is between 18
& 50 give the message “valid entry” otherwise give appropriate message. (Marks 15)
C) Write a function to accept the bus_no, date & print its allotted driver. (Marks 10)
Slip 23
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
*Note: Input data for the query should be specified by the examiner.
B) Write a trigger before insert or update on No_of_shares field. If it is zero, then raise an
exception and display the message “Number of shares cannot be zero”.
(Marks
15)
.
C) Write a function to display the person wise total no_of_shares. (Marks
10)
Slip 24
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
*Note: Input data for the query should be specified by the examiner.
B) Write a trigger before deleting a student record from the student table. Raise a
notice and display the message “student record is being deleted” (Marks
15)
Slip 25
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
*Note: Input data for the query should be specified by the examiner.
B) Calculate the length of pincode. Write a trigger which will fire before insert on
the cities table which check that the pincode must be of 6 digit. If it is more or
less then it display the appropriate message. (Marks 15)
Slip 26
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
C) Write a function to calculate city wise total cost of each newspaper.(Marks 10)
*Note: Input data for the query should be specified by the examiner.
Slip 27
Savitribai Phule Pune University
S.Y.B.Sc.(Computer Science) Practical Examination. April / Oct. - 20
Lab Course II
Database Practicals (PostGreSQL on Linux)& Mini Project using Software Engineering
Techniques
Duration: 3Hrs. Max Marks: 100
C) Write a function that returns the total number of suppliers of a particular city. (Accept
city name as input parameter) (Marks 10)
*Note: Input data for the query should be specified by the examiner.
Slip 28