CS_practical_qns
CS_practical_qns
1. i) Write a function WriteStudent() to write the Records of Students (admno, name, fee)
in a CSV file name “stud.csv”.
ii) Write a function Display() to display those records from a CSV file where fee is
greater than 2500
2. Consider the following tables Stationary and Consumer. Write SQL commands for the
statement (i) to (iv).
Table : Stationary
Table : Consumer
(ii) To display the details of Stationary whose Price is in the range of 8 to 15. (Both
Value included)
(iii) To display the ConsumerName, Address from Table Consumer, and Company and
Price from tableStationary, with their corresponding matching S_ID.
1. Create a python program named Count.py to read a text file – Mytext.txt and
display the number of upper case, lower case, digits and special
characters(including space).
2. Consider the following tables FACULTY and COURSES. Write SQL commands for the
statements (i) to (iv)
Table : FACULTY
Table : COURSES
ii) To display the details of courses whose fees is in the range of 15000 to 50000
(both values included).
iii) To increase the fees of all courses by 500 of “System Design” Course.
1. Write a python program using list to implement stack data structure and perform the
following operations:
a. Push()
b. Pop()
c. Display()
d. Peek()
Table : TRAINS
Table : PASSENGERS
(i) To display details of all Trains which Start from New Delhi.
(ii) To display the PNR, PNAME, GENDER and AGE of all Passengers whose AGE is
below 50.
(iv) To display details of all Passengers travelling in Trains whose TNO is 12015.
Q.No. 4
1. Write a Python Program to read a text file line by line and to display each word in the
file separated by “#”.
Table : TRAINER
Table : COURSE
(i) Display the Trainer Name, City & Salary in descending order of their Hiredate.
(ii) To display the TNAME and CITY of Trainer who joined the Institute in the month
of December 2001.
1. Implement two functions in python to create and access binary file “student.dat”.
i) Addbin() –to write a dictionary that holds students roll no and mark as key
value pairs into a binary file “student.dat”.
ii) Dispbin() – to display the roll numbers and marks of students who secured
more than 70 marks.
2. Write the queries for the i) to iv) based on the given tables.
Table : EmpSalary
Table : Employees
i) To show firstname, lastname, address and city of all employees living in paris
iii) To display the firstname, lastname and totalsalary of all managers from the tables
Employee and empsalary, where totalsalary is calculated as salary+benefits.
iv) To display the maximum salary among managers and clerks from the table
Empsalary.