You are on page 1of 1

JAI NARAYAN VIDYA MANDIR INTER COLLEGE

AISSCE PRACTICAL EXAMINATION-2022-23


Time 3 Hours SUBJECT: COMPUTER SCIENCE (083) M.M. : 30
SET: 02

Q1. LAB TEST [8+4=12]


A. 1) Write a function in Python that counts the number of “Me” or “My” words present in a text file
“STORY.TXT” (4)
2) Write function WriteStudent() to write the Records of 5 Students (admno, name, fee) in a binary file
name “stud.dat”, and Write function Display() those records from a binary which fee is less than
1500.
OR
Write function AddEmployee() to write the Records of 5 Employees (empid, ename, salary) in a CSV
file name “emp.csv”, and Write function ShowEmp() to display all records from a CSV file.

B. A table Drug is created in the database Medicine. The details of table are given below. (4)

import mysql.connector as sqltor


mycon = sqltor.connect( ) #1
cursor = mycon.cursor( )
cursor.execute( ) #2
data = #3
for rec in data:
print ( rec )
#4
mycon.close( )
a. Complete the statement #1 to write appropriate missing parameter and values.
b. Write the statement #2, to fetch drugName, and price from table Drug in descending order of price.
c. Complete the statement #3, to fetch only three records from the resultset.
d. What statement you will write in place of statement #2 to insert one more record in table Drug, as
well as in statement #4, to make your changes permanent in the table Drug.
Q.2 Report File (7)
Q.3 Project (8)
Q.4 Viva voce (3)

External Examiner Internal Examiner


Name : Name :
Sign : Sign :
Examiner No: Examiner No:

You might also like