Friday, 7 November 2025

Sample practical paper II

 SECTION A


1. Write a menu driven program to operate on a csv file courier.csv with each record as a list of the

form :

[courier_id, name, city, fees].

The menu should

a) Insert records into the file.

b) Display records, the total of the fees and the average fees

c) Search and display the details of a given courier_id

2. Your Principal has chosen you to to help maintain the records of grade 12 students in a stack format.

Each record should contain { ‘s_id’:int, ‘s_name’:str , ‘s_marks’: int}

You decide to implement stack data structure to maintain the records of your classmates to perform the

following operations on the stack , in a menu driven fashion

i) Push

ii) Pop

iii) Display (at the end of the display , print the average marks of the students, and the topper’s details)


SECTION B


3.Consider the following table:

Write SQL Queries to create the above tables and insert records into them, and write queries for

the following:

a) To display employee ids, names of employees, job ids with corresponding job titles. 

b) To display names of employees, sales and job titles who have achieved sales more than 1300000.

c) To display names who have ‘SINGH’ (anywhere) in their names.

d) Write SQL command to change the jobid to 104 of the employee with ID as E4 in the table

Employee.

e) Display a list of jobid, job name and number of employees

f) Display only the jobs with salary greater than or equal to the average salary.

g) Increase “manager” salary by 5 percent.

Sample practical paper - I

 SECTION A


1. Write a menu-driven program to operate on a binary file book.dat with each record stored as a list in

the form:

[book_id (int), book_title (string), price (int)].

The menu should perform the following operations:

a) Insert records into the file.

b) Display all records, the total cost of all books, and the average price of books.

c) Update the price of a given book_id, else display a suitable message.


2. You are an excellent coder. So your neighbour Amit, who owns a departmental store tells you to help

him maintain the records of a customer’s cart in a stack format.

You decide to implement stack data structure to maintain the records of the shopping cart to perform the

following operations on the stack the, in a menu driven fashion

i) Push

ii) Pop

iii) Display (at the end of the display , print the total price of the cart)

Note : Each record is of the structure :

{‘p_id’: int , ‘p_name’ :str , ‘price’: float}.


SECTION B


3. Create the below tables and write the SQL statements for the queries that follow :


1. Display the names of borrowers who borrowed a book in December 2024.

2. List the book titles borrowed by borrowers living in Mumbai.

3. Find the total number of books borrowed by each borrower( id and name).

4. Display the city-wise count of books borrowed in descending order of count.

5. List the names of borrowers who have not returned at least one book

6. Display the borrowers who have returned all the books .

7. Update return date of Kavya Iyer’s unreturned books to 2025-09-09.