AISSCE Computer Science PRACTICALS QP 4
AISSCE Computer Science PRACTICALS QP 4
com
All India Senior Secondary Certificate Examination
School Code: xxxxx
Time 3 Hours | Subject: Computer Science (083) | M.M. : 30
Q1. LAB TEST [8+4=12]
A. Write a program to write data into binary file marks.dat and display the records of students who scored
more than 95 marks.
OR
Write a program to copy the records of that student having marks more than 95 from binary file
“marks.dat” into the “topper.dat” file
B. Observe the following code and fill in the given blanks as directed:
import mysql.connector as mycon
mydb=mycon.connect(_______________________________________) # Statement 1
mycursor=mydb.___________ # Statemen 2
mycursor.execute(__________________________________________) # Statement 3
myresult = mycursor.__________ # Statement 4
for x in myresult:
print(x)
The partial code is given for displaying all records from customer table created . The
customer table is given as following:
CustomerID CustomerName City BillAmt MobileNo
111 Abhishek Ahmedabad 1500 9999999999
222 Ram kumar Chennai 1501 8888888888
i. Write the parameters and values required to fill statement 1. The parameters values are as
follows:
Database Server : localhost
User : root
Pasword : rootpass
Database : customer
ii. Write function name to create cursor and fill in the gap for statement 2.
iii. Write a query to fill statement 3 to display all records from customer table.
iv. Write function to fill statement 4 to fetch all records from customer table.