0% found this document useful (0 votes)
557 views

Lab Course-II Slips

This document contains instructions for a database practical examination involving PostgreSQL. It describes 3 questions: 1) Practical queries involving creating databases for people/areas, movies, banks, or students/teachers and executing queries on them. 2) An external project viva. 3) Evaluation of an internal project and PostgreSQL workbook. The questions involve creating databases, writing queries, stored functions with cursors, and views. Marks are allocated for creating the databases and implementing the various tasks. Input for the queries will be provided by the examiner.

Uploaded by

Aashish
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
557 views

Lab Course-II Slips

This document contains instructions for a database practical examination involving PostgreSQL. It describes 3 questions: 1) Practical queries involving creating databases for people/areas, movies, banks, or students/teachers and executing queries on them. 2) An external project viva. 3) Evaluation of an internal project and PostgreSQL workbook. The questions involve creating databases, writing queries, stored functions with cursors, and views. Marks are allocated for creating the databases and implementing the various tasks. Input for the queries will be provided by the examiner.

Uploaded by

Aashish
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

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

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Person–Area database


Person (pnumber integer, pname varchar (20), birthdate date, income money)
Area ( aname varchar (20), area-type varchar (5) )
An area can have one or more persons living in it, but a person belongs to exactly one area.
The attribute ‘area_type’ can have values either ‘urban’ or ‘rural’.

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. List the names of all people living in ‘_______’ area.
2. List the details of all people whose names start with the alphabet ‘__’.
OR
A) Count area wise people whose income is below______.

B) Write a cursor to update the income of all people living in ‘Urban’ area by 10%
(Marks 15)

C)Create a view containing details of all the people (Marks


10)
1) Whose birthday falls in the month of_______.
2) Sorted by person name.

Q.2) Project Viva (External). (Marks 25)

Q.3) Project Evaluation (Internal). (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*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

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Movie database


Movies (m_name varchar (25), release_year integer, budget money)
Actor (a_name char (30), role char (30), charges money, a_address varchar (30) )
Producer (producer_id integer, name char (30), p_address varchar (30) )
Each actor has acted in one or more movies. Each producer has produced many movies and
each movie can be produced by more than one producers. Each movie has one or more
actors acting in it, in different roles.

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1) List the names of actors who have acted in at least one movie, in which ‘_______’
has acted.
2) List the names of the movies with the highest budget.
OR
A) List the names of actors who are given the maximum charges for their movie along
with movie name & release year.

B) Write a stored function using cursors to display the names of actors who have acted in
the maximum number of movies. (Marks
15)

C) Create a view to (Marks 10)


1) List the names of producers who produce the same movie as ‘________’has
produced.
2) List the names of actors who do not live in _________or _________ city.

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*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

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Bank databasewhich 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).

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Find the names of customers for the “Hadapsar” branch.
2. List the names of customers who have received loan less than their requirement.
OR
A) List the names of the customer along with the branch names who have applied for
loan in the month of ________.

B) Write a cursor to print the total number of distinct customers along with their loan
approved amount. (Marks 15)

C) Create a view containing details of all (Marks 10)


1) Accounts of a customer
2) Loans from the ‘Manjari’ branch.

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*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

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Student-Teacher database maintained by a school.It also


gives information of the subject taught by the teacher.
Student (sno integer, s_name char(30), s_class char(10), s_addr Char(50))
Teacher (tno integer, t_name char (20), qualification char (15),experience integer)
The relationship is as follows:
Student-Teacher: M-M with descriptive attribute Subject.

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Find the number of teachers having qualification “Ph. D.”.
2. List the names of the students to whom “_______” is teaching.
OR
A)List the names of all teachers with their subjects along with the total number of
students they are teaching.

B) Write a cursor to accept the student name from the user & display student number, class
& address. (Marks 15)

C) Create a view to (Marks 10)


1) Find the minimum experienced teacher.
2) Find the subjects taught by each teacher.

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*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

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Project-Employee databasemaintained by a company


which stores the details of the projectsassigned to the employees.
Project (pno integer, p_name char(30), ptype char(20),duration integer)
Employee (eno integer, e_name char (20), qualification char (15), joindate date)
Project-Employee:M-M Relationship with descriptive attributes as start_date (date),
no_of_hours_worked(integer).

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. List the names of the first three employees in alphabetical order.
2. Find the details of employees working on the project “System”.
OR
A) Find the names of the employees starting with ’__’ along with their project names
& project type.

B) Write a stored function using cursors to find the list of employees whose joining date is
__________ . (Marks 15)

C) Create a view to (Marks 10)


1) Find the names of the employees who have worked for more than three years.
2) Find the employee numbers who do not work on project “Robotics”.

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*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

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

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)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Give the details for trips that exceed Rs. 10,000 in expenses.
2. Increase the expenses of all the trips by Rs. 5000.
OR
A) Delete all the trips made by department “computer” having expenses more
than Rs.15000.

B) Write a cursor to list all salesman’s name, his trip details & expenses.
(Marks 15)

C) Create a view to (Marks 10)


1) List the names of departments that have salesmen,who have done maximum number of
trips.
2) Find the total expenses incurred by the salesman “_________”.

Q.2) Project Viva (External) (Marks 25)


Slip 6
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

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Warehouse database.


Cities(city char(20),state char(20))
Warehouses(wid integer,wname char(30),location char(20))
Stores(sid integer,store_name char(20), location_city char(20))
Items(itemno integer,description text,weight decimal(5,2), cost Decimal(5,2) )
Customer(cno integer, cname char(50),addr varchar(50), cu_city Char(20))
Orders(ono int,odate date)
Cities-warehouses : 1 to M
Warehouses - stores : 1 to M
Customer – orders : 1 to M
Items – orders: M to M relationship with descriptive attribute ordered_quantity
Stores-items: M to M relation with descriptive attribute quantity

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Find the item that has minimum weight.
2. Find the different warehouses in “_______” location.
OR
A) Find the city wise details of orders given by each customer.

B) Write a stored function using cursors to accept a city from the user and list all
warehouses in that city. (Marks 15)

C) Create a view containing details of all the (Marks 10)


1) Stores of a Warehouse named ’Spares’.
2) Customers who have placed orders on the date ’________’.
Slip 7
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

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the followingrailway reservation database.


Train (train_no int, train_name varchar(20), depart_time time, Arrival_time time,
source_stn varchar(20), dest_stn varchar(20), No_of_res_bogies int, bogie_capacity
int)
Passenger (passenger_id int, passenger_name varchar(20), Address varchar(30), age
int, gender char)
Train _passenger : m-m with descriptive attributes as follows :
Ticket (train_no int, passenger_id int, ticket_no int , Bogie_no int, no_of_berths int, date
date, ticket_amt Decimal(7,2),status char composite key(train_no,passenger_id,ticket_no)).
The status of a particular berth can be ‘W‘ (waiting) or ‘C‘ (confirmed).

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Display names of passengers who have reserved no_of_berths>4 of ‘Hawara
Express’ on ________.
2. Delete the bookings of ‘_____’ of ‘Yamuna Fast’ on _______.
OR
A) Display the train names having 3 bogies from ‘Mumbai’ to ‘Pune’

B) Write a stored function using cursors to find the confirmed bookings of all the trains on
________. (Marks 15)

C) Create a view to (Marks 10)


1) List passenger names of ‘Shatabdi Express’ whose ticket status is waiting on _____
Slip 8
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

2) List the passengers travelling from ‘Pune’ to ‘Mumbai’.

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Bus transport Database.


Bus (bus_no int , capacity int , depot_name varchar(20))
Route (route_no int, source char(20), destination char(20), No_of_stations int)
Driver (driver_no int, driver_name char(20), license_no int, address Char(20), d_age int,
salary float)
Bus_Route : M-1 and Bus_Driver : M-M with descriptive attributes date of duty allotted
and shift can be 1(Morning) or 2 ( Evening ).
Constraints:1. License_no is unique. 2. Bus capacity is not null.

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Find out the name of the driver having maximum salary.
2. Delete the record of bus having capacity < 10
OR
A) Print the names of drivers working in both shifts on ______.

B) Write a stored function using cursors to display the details of a driver. (Accept
driver name as input parameter). (Marks 15)

C) Create a view (Marks 10)


1) which contains details of bus no 10 along with details of all drivers who have
driven that bus.
Slip 9
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

2) To display the details of the buses that run on routes 1or 2.

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Company –Person database


Company(name varchar(30),address varchar(50),city varchar(20), phone varchar(10),
share_value money)
Person(pname varchar(30),pcity varchar (20))
Company_Person : M to M relationship with descriptive attribute No_of_shares integer

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. List all the names of companies starting with ‘_______’.
2. List all the person names who live in ________.
OR
A)Display the name of person with maximum share value.

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

Q.2) Project Viva (External) (Marks 25)


Slip 10
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

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Student –Marks database


Student (rollno integer, name varchar(30), address varchar(50), class varchar(10))
Subject (scode varchar(10), subject_name varchar(20))
Student-Subject are related with M-M relationship with attributes marks_scored.
Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Display the names of students scoring the maximum total marks.
2. List the distinct names of all the subjects.
OR
A) Display class wise &subject wise student list.

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)

C) Create a view (Marks 10)


1) To list student name, class & total marks scored by each student ,sorted by student
name.
2) To list student names along with subject name and marks who scored more than

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.

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following News paper database


Newspaper (name varchar(20), language varchar(20), publisher varchar(20), cost
money)
Cities (pincode varchar(6), city varchar(20), state varchar(20))
Newspaper & Cities M to M relationship with descriptive attribute daily_required
(integer).

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. List the names of all newspapers.
2. List the names of all city starting with ‘________’.
OR
A) List the names of all newspaper, publisher distributed in city ____.

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)

C) Create a view (Marks 10)


1) Containing all the details of newspaper named ‘Sakal’.
2) To list the state wise names of all newspaper whose daily_required>5000.

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Item_Supplier database


Item (itemno integer, itemname varchar(20))
Supplier (supplier_No integer, supplier_name varchar (20), address varchar (20),
city varchar (20) )
Item-Supplier : many to many relationship with rate (money) & , quantity integer as a
descriptive attribute.

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. List the details all items.
2. List the details all suppliers.
OR
B) Display item wise supplier list.

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)

C) Create a view (Marks 10)


1) Containing details of all the suppliers supplying ‘Notebooks’.
2) Which contains details of all items supplied from ‘Pune’

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Person–Area database


Person (pnumber integer, pname varchar (20), birthdate date, income money)
Area (aname varchar (20), area_type varchar (5) )
An area can have one or more persons living in it, but a person belongs to exactly one area.
The attribute ‘area_type’ can have values either ‘urban’ or ‘rural’.

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. List the names of all people whose income is between ______and _______.
2. List the names of all people whose birthday falls in the month of_______.
OR

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

A) List names of persons whose income is same.

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)

Q.2) Project Viva (External). (Marks 25)

Q.3) Project Evaluation (Internal). (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (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

.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Movie database


Movies (m_name varchar (25), release_year integer, budget money)
Actor (a_name char (30), role char (30), charges money, a_address varchar (30) )
Producer (producer_id integer, name char (30), p_address varchar (30) )
Each actor has acted in one or more movies. Each producer has produced many movies and
each movie can be produced by more than one producers. Each movie has one or more
actors acting in it, in different roles.

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1) List the names of movies released after 2000.
2) List the names of actors who played the role of ‘Villan’.
OR
A) Display count & total budget of all movies released in year 2014.

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)

C) Write a function to list movie-wise charges of “Amitabh Bachchan’.


(Marks 10)

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*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

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

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

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Find the names of customers who require loan with amount > 100000.
2. Find the maximum loan amount approved.
OR
A) List the names of customers who have taken loan from branch in the same city
where they live.

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)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*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

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Student-Teacher database maintained by a school. It also


gives information of the subject taught by the teacher.
Student (sno integer, s_name char(30), s_class char(10), s_addr Char(50))
Teacher (tno integer, t_name char (20), qualification char (15),experience integer)
The relationship is as follows:
Student-Teacher: M-M with descriptive attribute Subject.

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Find the number of students living in ‘Deccan’
2. List the names of teachers teaching ‘RDBMS’.
OR
A) List the names of students who are taught by most experienced teacher.

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)

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (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

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Project-Employee database maintained by a company


whichstores the details of the projects assigned to the employees.
Project (pno integer, p_name char(30), ptype char(20), duration integer)
Employee (eno integer, e_name char (20), qualification char (15), joindate date)
Project-Employee:M-M Relationship with descriptive attributes as start_date (date),
no_of_hours_worked(integer).

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. List the names of employees who have worked for more than 20 hours on any
project.
2. Find the details of project of type “Robotics”.
OR
A) Find the names of the employees who are ‘M.Tech.’ & started the project on
‘1.1.2014’

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)

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (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.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

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)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Give the details of salesmen who started working before 2000.
2. List the salesmen whose names start with ‘_____’.
OR
A) List the names departments, that have salesman, who have done maximum numbers of
trips.

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)

Q.2) Project Viva (External) (Marks 25)


Slip 20
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

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Warehouse database.


Cities (city char(20), state char(20))
Warehouses (wid integer, wname char(30), location char(20))
Stores (sid integer, store_name char(20), location_city char(20))
Items (itemno integer, description text, weight decimal(5,2), cost Decimal(5,2) )
Customer (cno integer, cname char(50), addr varchar(50), cu_city Char(20))
Orders (ono int, odate date)
Cities-warehouses : 1 to M
Warehouses - stores : 1 to M
Customer – orders : 1 to M
Items – orders: M to M relationship with descriptive attribute ordered_quantity
Stores-items: M to M relation with descriptive attribute quantity

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Find the total cost of all items.
2. Find the different warehouses in “Pune”.
OR
A) Find the stores-wise quantity of each item.

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

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.
Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following railway reservation database.


Train (train_no int, train_name varchar(20), depart_time time, Arrival_time time,
source_stn varchar(20), dest_stn varchar(20), No_of_res_bogies int, bogie_capacity
int)
Passenger (passenger_id int, passenger_name varchar(20), Address varchar(30), age
int, gender char)
Train _passenger : m-m with descriptive attributes as follows :
Ticket (train_no int, passenger_id int, ticket_no int, Bogie_no int, no_of_berths int, date
date, ticket_amt Decimal(7,2),status char,composite key(train_no,passenger_id,ticket_no)).
The status of a particular berth can be ‘W‘ (waiting) or ‘C‘ (confirmed).

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Count no. of passengers for ‘Deccan Queen’.
2. Update status from ‘W’ to ‘C’ for ‘Shatabdi Express’ on ‘_________’ date.
OR
A) Display the passengers going from ‘________’ to ‘_______’ between dates ‘____’
to ‘______’.

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)

Q.2) Project Viva (External) (Marks 25)


Slip 22
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

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Bus transport Database.


Bus (bus_no int , capacity int , depot_name varchar(20))
Route (route_no int, source char(20), destination char(20), No_of_stations int)
Driver (driver_no int, driver_name char(20), license_no int, address Char(20), d_age int,
salary float)
Bus_Route : M-1 and Bus_Driver : M-M with descriptive attributes date of duty allotted
and shift can be 1(Morning) or 2 ( Evening ).
Constraints :
1. License_no is unique.
2. Bus capacity is not null.

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Increase the salary of all drivers by 5% if driver’s age > 45.
2. Find out the route details on which buses of capacity 20 run.
OR
A) Print the names & license nos. of drivers working on ___________ in both shifts.

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)

Q.2) Project Viva (External) (Marks 25)

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

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Company –Person database


Company (name varchar(30), address varchar(50), city varchar(20), phone varchar(10),
share_value money)
Person (pname varchar(30), pcity varchar (20))
Company_Person : M to M relationship with descriptive attribute No_of_shares integer

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1.List all the person names who have shares with company having minimum share-
value.
2. List city-wise companies &personsin descending order.
OR
A) Increase no.of shares value by 10% for person,who hold shares with maximum no.of
companies.

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

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Student –Marks database


Student (rollno integer, name varchar(30), address varchar(50), class varchar(10))
Subject (scode varchar(10), subject_name varchar(20))
Student-Subject are related with M-M relationship with attributes marks_scored.
Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. Count no. of students from class SY who have opted for subject RDBMS
2. List all the subjects of class FY.
OR
A) Display top 3 students in the subject “DBMS” from FYBSc class.

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)

C) Write a function to calculate total & percentage of each student. (Marks


10)

Q.2) Project Viva (External) (Marks 25)

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

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following News paper database


Newspaper (name varchar(20), language varchar(20), publisher varchar(20), cost
money)
Cities (pincode varchar(6), city varchar(20), state varchar(20))
Newspaper & Cities M to M relationship with descriptive attribute daily_required
(integer).

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL


1. Count no. of Marathi newspaper in city “Pune”
2. List the names of all cities whose pincode end with 10.
OR (Marks 10)
A) List the details of newspaper along with city whose daily-required count is
maximum.

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)

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Q.1) Practical Question on PostGreSQL (Total Marks 40)

Note:- 1. Insert sufficient number of appropriate records in the database.


2. Read the question carefully and insert data in the database accordingly.
3. Count queries output should be more than 2 records. (if asked)
4. No question should generate empty output.

Consider the following Item_Supplier database


Item (itemno integer, itemname varchar(20))
Supplier (supplier_No integer, supplier_name varchar (20), address varchar (20),
city varchar (20) )
Item-Supplier : many to many relationship with rate (money) & quantity integer as a
descriptive attribute.

Create the above database in PostGreSQL. (Marks 5)

A) Execute the following queries in PostGreSQL (Marks


10)
1. List the details of items that are brought in maximum quantity.
2. List city-wise suppliers in ascending order.
OR
A) List the supplier who supply item “keyboard” at lowest rate.

B) Write a stored function to print the total number of suppliers of a


particular item. ( Accept item name as input parameter.) In case the
item name is invalid, raise an exception for the same. (Marks 15)

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)

Q.2) Project Viva (External) (Marks 25)

Q.3) Project Evaluation (Internal) (Marks 25)

Q.4) Assessment of PostGreSQL workbook (Internal) (Marks 10)

*Note: Input data for the query should be specified by the examiner.

Slip 28

You might also like