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.
No comments:
Post a Comment