You are on page 1of 4

PGM NO: 5 TEXT FILE – 1

1. Write a menu-driven Python program to read a text file and display


the number of vowels, consonants, uppercase characters, lowercase
characters and digits in the file.

2. Create a database called SSCE_PRAC_<ROLLNO> and activate it.


Create a table called FACULTY and COURSES, insert the records as per
the table given below.
TABLE: FACULTY TABLE: COURSES

Write SQL queries for the following: (4)


(i) To display details of those faculties whose salary is greater than
12000.
(ii) To increase the fees by 500 for “System Design” and “Human Biology”
Courses.
(iii) To display details of those courses which are taught by ‘Sulekha’ in
descending order of courses name.
(iv) To display First Name, Last Name, Salary, Course Name and Fees
from both the tables, whose salary is greater than 10000, Hire_date is
above ‘01-01-2000’ and their Last name ends with ‘a’.

PGM NO: 7 TEXT FILE – 3


1. Write a menu-driven Python program to read a text file and do the
following tasks:
● To count the number of lines in the file.
● To count the number of times a character appears.
● To count the number of times a word appears.

2. Create a database called SSCE_PRAC_<ROLLNO> and activate it.


Create a table called TEACHER and SALARY, insert the records as given
below.
TABLE: TEACHER TABLE: SALARY

Page 1 of 4
Write SQL queries for the following:
(i) To display the name of all the male teachers who belong to either
Physics or Chemistry
department.
(ii) To display the total number of teachers, maximum and minimum
salary earned by the teachers.
(iii) To display the teacher’s name and department of the teachers whose
name contains the letter ‘a’ and do not belong to Physics
department.
(iv) To display a report containing tid, teacher name, department,
gender,
gross salary(BASIC+ALLOWANCE+DA) and PF(BASIC * 0.12).

PGM NO: 8 BINARY FILE – 1


Write a Python program with the following specification: Create a binary
file to store the details of the Course as follows.
List name: Course
List values: CourseID, Course Name, Faculty Name, Fees
The program must have the following options.
● Enter data into the file
● Search a record based on CourseId and display course name and
fees
● Display all the records
2. Create a database called SSCE_PRAC_<ROLLNO> and activate it. Create a
table called GYM and insert the records as per the table given below.
TABLE: GYM

Write SQL queries for the following:


(i) To display mcode, mname, age of all female members of the gym in
descending order of their age.
(ii) To display the mname, feegiven of all those members of the gym whose age
is less than 40 and monthly type members of gym.
(iii) To display the type along with sum and average of feegiven for each type.
(iv) To display type along with number of male members whose age is above 30,
in each type.

Page 2 of 4
PGM NO: 9 BINARY FILE – 2
1. Write a Python program to get the details of 'n' items (Itemno, Name,
Price, Category) from the user and write it to a binary file. Search for a
particular item using Itemno and update the price of the product.

2. Create a database called SSCE_PRAC_<ROLLNO> and activate it. Create a


table called SUPPLIER and PRODUCT, insert the records as given below.
TABLE: SUPPLIER TABLE: PRODUCT

Write SQL queries for the following:


(i) To display product name and price of all those products whose price is in the
range of 10000 and 15000 (both values inclusive).
(ii) To display the supplier code and sum of price of products, where the number
of products by the supplier is more than 1.
(iii) To display the maximum price along with the product name and supplier
name for each supplier.
(iv) To display the output of equi-join on both the tables.

PGM NO: 12 CSV FILE – 2


1. Write a menu driven Python program to append, read and update
records from a CSV file containing the details of Employee (Empid,
Name, Department, Salary) stored as a list. Get empid as input to
update the salary.
2. Create a database called SSCE_PRAC_<ROLLNO> and activate it.
Create a table called BILL and insert the records, as given below.
TABLE: BILL

Write SQL queries for the following:


(i) To display the cust_id and total amount (qty*price) of items purchased
by each customer.
(ii) To display the cust_id, order date and item in descending order of order
Page 3 of 4
date and the item are either brownie or ice cream.
(iii) To display item name and total amount (qty * price) calculated
itemwise.
(iv) To display the customer id, item and price of those items whose
names contain the letters either “e” or “c”.

PGM NO: 15 STACK – 2


Write a menu-driven Python program to Push, Pop, Peek, Search and
Display the elements from a STACK containing the details of Student
name, mark in Computer science as a list.
2. Create a database called SSCE_PRAC_<ROLLNO> and activate it. Create a
table called FACULTY and COURSES, insert the records as per the table given
below.
TABLE: FACULTY TABLE: COURSES

Write SQL queries for the following: (4)


(i) To display details of those faculties whose salary is greater than 12000.
(ii) To increase the fees by 500 for “System Design” and “Human Biology”
Courses.
(iii) To display details of those courses which are taught by ‘Sulekha’ in
descending order of courses name.
(iv) To display First Name, Last Name, Salary, Course Name and Fees from both
the tables, whose salary is greater than 10000, Hire_date is above ‘01-01-
2000’ and their Last name ends with ‘a’.

Page 4 of 4

You might also like