You are on page 1of 11

SET-1

Python (08m) SQL(04m) Record(07) Project(08) Viva(3m)


1)Write a menu driven Python program to implement a stack operations push(),pop() and display() using a
list. [BOOKNO, BOOKNAME, PRICE]
2) Write the SQL command for the following statements (i) to (iv)
Table Watches
Watchid Watch_Name Price Type Qty_Store
W001 HighTime 10000 Unisex 100
W002 LifeTime 15000 Ladies 150
W003 Wave 20000 Gents 200
W004 HighFashion 7000 Unisex 250
W005 GoldenTime 25000 Gents 100
(a) Display all the details of those watches whose name ends with‘Time’
(b) Display watch’s name and price of those watches which have price range in between
5000- 15000.
(c ) Display total quantity in store of Unisex type watches.
(d) Display Type and Qty_store of each type

ANSWER
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m)

stk=[]
def push():
bookno=int(input("enter book number"))
bname=input("enter book name")
price=int(input("Enter price"))
b=[bookno,bname,price]
stk.append(b)

def pop():

if len(stk)==0:
print("stack empty")

else:
print("The popped element is:",stk.pop())

def display():
if len(stk)==0:
print("stack empty")
else:
for i in stk[::-1]:
print(i)

while True:
print(""" MENU
1. PUSH
2. POP
3. DISPLAY"""
)
ch=int(input("Enter your choice: (1/2/3)"))
if ch==1:
push()
elif ch==2:
pop()
elif ch==3:
display()
else:
break
1. SQL

a) SELECT * FROM WATCHES WHERE WATCH_NAME LIKE “%TIME”;

b) SELECT WATCH_NAME,PRICE FROM WATCHES WHERE PRICE BETWEEN


5000 AND 15000;

c) SELECT SUM(QTY_STORE) FROM WATCHES WHERE TYPE = “UNISEX”;

d) SELECT TYPE, SUM(QTY_STORE) FROM WATCHES GROUP BY TYPE;


Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
1. Write a menu driven program to create a dictionary containing names and marks as key value pairs
{SNAME:MARKS} of some students and separate user defined functions to perform the following operations:
● Push the keys (name of the student) of the dictionary into a stack, where the corresponding value (marks) is
greater than 75.
● Pop an element of the stack.
● display the content of the stack.
2) Write the SQL command for the following statements (i) to (iv)
Games

Numb
Gcode GameName Type er Prizemoney Scheduledate
101 Carom Board Indoor 2 5000 23-jan-2004
102 Badminton Outdoor 2 12000 12-Dec-2003
103 Table Tennis Indoor 4 8000 14-Feb-2004
105 Chess Indoor 2 9000 01-jan-2004
108 Lawin Tennis Outdoor 4 25000 19-Mar-2004
(a) Display the details of outdoor games from the table games.
(b) Display details of those Games which are having Prizemoney more than 7000.
(c ) Display details of table Games in descending order of prizemoney
(d) Display sum of prizemoney for each type of Games.

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-2 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
1. Write a menu driven program to create a dictionary containing names and marks as key value pairs
{SNAME:MARKS} of some students and separate user defined functions to perform the following operations:
● Push the keys (name of the student) of the dictionary into a stack, where the corresponding value (marks) is
greater than 75.
● Pop an element of the stack.
● display the content of the stack.
2) Write the SQL command for the following statements (i) to (iv)
Games

Numb
Gcode GameName Type er Prizemoney Scheduledate
101 Carom Board Indoor 2 5000 23-jan-2004
102 Badminton Outdoor 2 12000 12-Dec-2003
103 Table Tennis Indoor 4 8000 14-Feb-2004
105 Chess Indoor 2 9000 01-jan-2004
108 Lawin Tennis Outdoor 4 25000 19-Mar-2004

(a) Display the details of outdoor games from the table games.
(b) Display details of those Games which are having Prizemoney more than 7000.
(c ) Display details of table Games in descending order of prizemoney
(d) Display sum of prizemoney for each type of Games.

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-3 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
1. A menu driven program in Python using Pickle library and create a binary file with following structure
* Admn no * Name * Age
Display the contents of the binary file
Search & display a student by admission number given by user.
2. Write the SQL command for the following statements (i) to (iv)

(a) Display FL_NO and NO_FLIGHTS from “KANPUR” to “BANGLORE” from the table
FLIGHTS.
(b) Display the contents of the table FLIGHTS in the ascending order of FL_NO.
(c) Display flight details whose ending is “Mumbai”
(d) Display number of records in the table Flights

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-3 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
1. A menu driven program in Python using Pickle library and create a binary file with following structure
* Admn no * Name * Age
Display the contents of the binary file
Search a student by admission number given by user.
2.Write the SQL command for the following statements (i) to (iv)

(a) Display FL_NO and NO_FLIGHTS from “KANPUR” to “BANGLORE” from the table
FLIGHTS.
(b) Display the contents of the table FLIGHTS in the ascending order of FL_NO.
(c) Display flight details whose ending is “Mumbai”
(d) Display number of records in the table Flights

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-4 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)

1. Write a Python program to create a emp.CSV file with empid, name and mobile number. Search by name and
display the records.
2. Write the SQL command for the following statements (i) to (iv)
Table : Faculty
F_I
D Fname Lname Hire_date Salary
102 Amit Mishra 12-10-1998 12000
103 Nitin Vyas 24-12-1994 8000
104 Rakshit Soni 18-05-2001 14000
105 Rashmi Malhotra 11-09-2004 11000
106 Sulekha Srivastava 05-06-2006 10000
(a) Display details of those Faculties whose salary is greater than 12000.
i (b) Display the details of courses whose fees is in the range of 15000 to 50000 (both
values included).
iii (c ) Increase the salary by 5000 of “Amit” .
i (d) Display details of Faculty in descending order of salary.
v

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-4 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)

1.Write a Python program to create a emp.CSV file with empid, name and mobile number. Search by name and
display the records.
2. Write the SQL command for the following statements (i) to (iv)
Table : Faculty
F_I
D Fname Lname Hire_date Salary
102 Amit Mishra 12-10-1998 12000
103 Nitin Vyas 24-12-1994 8000
104 Rakshit Soni 18-05-2001 14000
105 Rashmi Malhotra 11-09-2004 11000
106 Sulekha Srivastava 05-06-2006 10000
(a) Display details of those Faculties whose salary is greater than 12000.
i (b) Display the details of courses whose fees is in the range of 15000 to 50000 (both
values included).
iii (c ) Increase the salary by 5000 of “Amit” .
i (d) Display details of Faculty in descending order of salary.
COMPUTER SCIENCE 083 MAX. MARKS: 30
CLASS : XII SET-5 TIME ALLOWED :3. 00 hrs

SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)


Python (08m)
1. Write a menu driven program to perform following operations into a binary file travel.dat.
[ Travelid , From, To]
*Append data to the file.
*Display all the records
2. Write SQL commands for the following statements
Table : Courses
C_I
D F_ID Cname Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer Security 8000
C24 106 Human Biology 15000
Computer
C25 102 Network 20000
C26 105 Visual Basic 6000

(a) Display details of courses in ascending order of cname


I (b) Display details of courses whose fees is in the range of 15000 to 50000 (both values
included).
Ii (c ) To increase the fees of all courses by 500 of “System Design” Course.
i (d) To display how many courses are specified in the table Courses

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-5 TIME ALLOWED :3. 00 hrs
SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
Python (08m)
1.Write a menu driven program to perform following operations into a binary file travel.dat.
[Travelid , From, To]
*Append data to the file.
*Display all the records
2. Write SQL commands for the following statements
Write SQL commands for the following statements
Table : Courses
C_I
D F_ID Cname Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer Security 8000
C24 106 Human Biology 15000
Computer
C25 102 Network 20000
C26 105 Visual Basic 6000

(a) Display details of courses in ascending order of cname


I (b) Display details of courses whose fees is in the range of 15000 to 50000 (both values
included).
Ii (c ) To increase the fees of all courses by 500 of “System Design” Course.
i (d) To display how many courses are specified in the table Courses
COMPUTER SCIENCE 083 MAX. MARKS: 30
CLASS : XII SET-6 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m)
1)Write a menu driven Python program to implement a stack operations push(),pop() and display() using a
list. [Rollno, Average]
2) Write the SQL command for the following statements (i) to (iv)
Table Watches
Watchid Watch_Name Price Type Qty_Store
W001 HighTime 10000 Unisex 100
W002 LifeTime 15000 Ladies 150
W003 Wave 20000 Gents 200
W004 HighFashion 7000 Unisex 250
W005 GoldenTime 25000 Gents 100
(a) Display all the details of those watches whose name ends with‘Time’
(b) Display watch’s name and price of those watches which have price range in between
5000- 15000.
(c ) Display total quantity in store of Unisex type watches.
(d) Display Type and Qty_store of each type

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-6 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m)
1)Write a menu driven Python program to implement a stack operations push(),pop() and display() using a
list. [Rollno, Average]
2) Write the SQL command for the following statements (i) to (iv)
Table Watches
Watchid Watch_Name Price Type Qty_Store
W001 HighTime 10000 Unisex 100
W002 LifeTime 15000 Ladies 150
W003 Wave 20000 Gents 200
W004 HighFashion 7000 Unisex 250
W005 GoldenTime 25000 Gents 100
(a) Display all the details of those watches whose name ends with‘Time’
(b) Display watch’s name and price of those watches which have price range in between
5000- 15000.
(c ) Display total quantity in store of Unisex type watches.
(d) Display Type and Qty_store of each type

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-7 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
1. Write a menu driven program to create a dictionary containing bname and price as key value pairs
{BNAME:price} of books and separate user defined functions to perform the following operations:
● Push the keys (name of the book) of the dictionary into a stack, where the corresponding value (price ) is greater
than 500
● Pop an element of the stack.
● display the content of the stack

2) Write the SQL command for the following statements (i) to (iv)
Games

Numb
Gcode GameName Type er Prizemoney Scheduledate
101 Carom Board Indoor 2 5000 23-jan-2004
102 Badminton Outdoor 2 12000 12-Dec-2003
103 Table Tennis Indoor 4 8000 14-Feb-2004
105 Chess Indoor 2 9000 01-jan-2004
108 Lawin Tennis Outdoor 4 25000 19-Mar-2004
(a) Display the details of outdoor games from the table games.
(b) Display details of those Games which are having Prizemoney more than 7000.
(c ) Display details of table Games in descending order of prizemoney
(d) Display sum of prizemoney for each type of Games.

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-7 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
1. Write a menu driven program to create a dictionary containing bname and price as key value pairs
{BNAME:price} of books and separate user defined functions to perform the following operations:
● Push the keys (name of the book) of the dictionary into a stack, where the corresponding value (price ) is greater
than 500
● Pop an element of the stack.
● display the content of the stack

2) Write the SQL command for the following statements (i) to (iv)
Games

Numb
Gcode GameName Type er Prizemoney Scheduledate
101 Carom Board Indoor 2 5000 23-jan-2004
102 Badminton Outdoor 2 12000 12-Dec-2003
103 Table Tennis Indoor 4 8000 14-Feb-2004
105 Chess Indoor 2 9000 01-jan-2004
108 Lawin Tennis Outdoor 4 25000 19-Mar-2004
(a) Display the details of outdoor games from the table games.
(b) Display details of those Games which are having Prizemoney more than 7000.
(c ) Display details of table Games in descending order of prizemoney
(d) Display sum of prizemoney for each type of Games.

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-8 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
1. A menu driven program in Python using Pickle library and create a binary file with following structure
* courseid * course Name * course fee
Display the contents of the binary file
Search a course details by coursename given by user.
2.Write the SQL command for the following statements (i) to (iv)

(a) Display FL_NO and NO_FLIGHTS from “KANPUR” to “BANGLORE” from the table
FLIGHTS.
(b) Display the contents of the table FLIGHTS in the ascending order of FL_NO.
(c) Display flight details whose ending is “Mumbai”
(d) Display number of records in the table Flights

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-8 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
1. A menu driven program in Python using Pickle library and create a binary file with following structure
* courseid * course Name * course fee
Display the contents of the binary file
Search a course details by coursename given by user.
2.Write the SQL command for the following statements (i) to (iv)

(a) Display FL_NO and NO_FLIGHTS from “KANPUR” to “BANGLORE” from the table
FLIGHTS.
(b) Display the contents of the table FLIGHTS in the ascending order of FL_NO.
(c) Display flight details whose ending is “Mumbai”
(d) Display number of records in the table Flights

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-9 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
1. Write a Python program to create a emp.CSV file with pid, pname and price. Search by pid and display the
records.
2. Write the SQL command for the following statements (i) to (iv)
Table : Faculty
F_I
D Fname Lname Hire_date Salary
102 Amit Mishra 12-10-1998 12000
103 Nitin Vyas 24-12-1994 8000
104 Rakshit Soni 18-05-2001 14000
105 Rashmi Malhotra 11-09-2004 11000
106 Sulekha Srivastava 05-06-2006 10000
(a) Display details of those Faculties whose salary is greater than 12000.
i (b) Display the details of courses whose fees is in the range of 15000 to 50000 (both
values included).
iii (c ) Increase the salary by 5000 of “Amit” .
i (d) Display details of Faculty in descending order of salary.
v

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-9 TIME ALLOWED :3. 00 hrs
Python (08m) SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
1. Write a Python program to create a emp.CSV file with pid, pname and price. Search by pid and display the
records.
2. Write the SQL command for the following statements (i) to (iv)
Table : Faculty
F_I
D Fname Lname Hire_date Salary
102 Amit Mishra 12-10-1998 12000
103 Nitin Vyas 24-12-1994 8000
104 Rakshit Soni 18-05-2001 14000
105 Rashmi Malhotra 11-09-2004 11000
106 Sulekha Srivastava 05-06-2006 10000
(a) Display details of those Faculties whose salary is greater than 12000.
i (b) Display the details of courses whose fees is in the range of 15000 to 50000 (both
values included).
iii (c ) Increase the salary by 5000 of “Amit” .
i (d) Display details of Faculty in descending order of salary.
v

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-10 TIME ALLOWED :3. 00 hrs
SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
Python (08m)
1. a) Write a menu driven program to perform following operations into a binary file sports.dat.
[sportsname , coachname]
*Append data to the file.
*Display all the records
2. Write SQL commands for the following statements
Write SQL commands for the following statements
Table : Courses
C_I
D F_ID Cname Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer Security 8000
C24 106 Human Biology 15000
Computer
C25 102 Network 20000
C26 105 Visual Basic 6000

(a) Display details of courses in ascending order of cname


I (b) Display details of courses whose fees is in the range of 15000 to 50000 (both values
included).
Ii (c ) To increase the fees of all courses by 500 of “System Design” Course.
i (d) To display how many courses are specified in the table Courses

COMPUTER SCIENCE 083 MAX. MARKS: 30


CLASS : XII SET-10 TIME ALLOWED :3. 00 hrs
SQL(04m) Record(07) Project(08) Viva(3m) Total (30m)
Python (08m)
1. Write a menu driven program to perform following operations into a binary file sports.dat.
[sportsname , coachname]
*Append data to the file.
*Display all the records
2. Write SQL commands for the following statements
Write SQL commands for the following statements
Table : Courses
C_I
D F_ID Cname Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer Security 8000
C24 106 Human Biology 15000
Computer
C25 102 Network 20000
C26 105 Visual Basic 6000

(a) Display details of courses in ascending order of cname


I (b) Display details of courses whose fees is in the range of 15000 to 50000 (both values
included).
Ii (c ) To increase the fees of all courses by 500 of “System Design” Course.
i (d) To display how many courses are specified in the table Courses

You might also like