Prac Qus CS
Prac Qus CS
Prac Qus CS
LAB TEST :
1. Create a menu driven program in Python using Pickle library and 8
• Create a binary file with following structure
Employee name
Employee no
• Display the contents of the binary file.
2. Consider the following tables FACULTY and COURSES. Write SQL commands for the 4
statements (i) to (iv)
(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.
(iii)To display total number of MALE and FEMALE Passengers.
(iv)To display details of all Passengers travelling in Trains whose TNO is 12015.
LAB TEST :
1. Create a Python based Stack Program on implementation of stack using list data structure. 8
Push a stack
Pop a stack
Display a stack
2. Consider the following tables FACULTY and COURSES. Write SQL commands for the 4
statements (i) to (iv)
FACULTY
F_ID Fname Lname Hire date Salary
102 Amit Mishra 12-10-1998 12000
103 Nitin Vyas 24-12-1994 8000
104 Rakshit Soni 18-5-2001 14000
105 Rashmi Malhotra 11-9-2004 11000
106 Sulekha Srivastava 5-6-2006 10000
COURSES
C_ID F_ID Cname Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer Security 8000
C24 106 Human Biology 15000
C25 102 Computer Network 20000
C26 105 Visual Basic 6000
(i) To display details of those Faculties whose salary is greater than 12000.
(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.
(iv) To display details of those courses which are taught by ‘Sulekha’ in descending order of
courses.
1. To display the details of all Items in the STOCK table in ascending order of StockDate.
2. To display ItemNo and Item name of those items from STOCK table whose UnitPrice is more than
Rupees 10.
3. To display the details of those items whose dealer code (Dcode) is 102 or quantity in STOCK (Qty)
is more than 100 from the table Stock.
4. To display maximum UnitPrice of items for each dealer individually as per Dcode from the table
STOCK.
Answer:
(a)
1. To display the details of all the products in ascending order of product names (i.e., PNAME).
2. To display the price, product name and quantity (i.e., qty) of those products which have quantity
more thhn 100.
3. To display the names of those suppliers, who are either from DELHI or from CHENNAI.
4. To display the name of the companies and the name of the products in descending order of
company names.
Answer: