You are on page 1of 3

SSCE PRACTICAL EXAMINATION 2023

Subject: Computer Science (083) New

Max Marks – 30 Time – 3 Hours


Date:
SET-1

1. Write a program to implement a Stack for these book-details (book no, 8


book name). That is, now each item node of the Stack contains two
types of information – a book no and its name. Write Push, Pop and
Display function.
2. Your friend Jagdish is writing a code to fetch data from a database Shop 4
and table name Products using Python. He has written incomplete code.
You have to help him write complete code:
import as_______ m # Statement-1
object1 = m.connect(host="localhost", user="root", password="root",
database="Shop")
object2 = object1.__________ # Statement-2
query = '''SELECT * FROM Products WHERE NAME LIKE "A%";'''
object2.__________ (query) # Statement-3
object1.__________ # Statement-4

3. Report file 7
4. Project 8
5. Viva voce 3
SSCE PRACTICAL EXAMINATION 2023
Subject: Computer Science (083) New

Max Marks – 30 Time – 3 Hours


Date:
SET-2

1. Create a binary file with name and roll number. Search for a given roll 8
number and display the name, if not found display appropriate message.
2. The code given below reads the following record from the table named 4
emp and displays only those records who have salary greater than
15000

ENo – integer
Name – string
Desig – string
Salary – integer
Note the following to establish connectivity between Python and
MYSQL:
• Username is root
• Password is tiger
• The table exists in a MYSQL database named organization. Write the
following missing statements to complete the code:
Statement 1 – to form the cursor object
Statement 2 – to execute the query that extracts records of those
employees whose salary is greater than 15000.
Statement 3- to read the complete result of the query (records whose
salary is greater than 15000) into the object named data, from the table
emp in the database.

import _____________ as mysql #Statement 1


def sql_data():
con1=mysql.connect(host="localhost",user="root",password="tiger",
database="organization")
mycursor=_______________ #Statement 2
print("Employees with salary greater than 15000 are : ")
_________________________ #Statement 3
data=__________________ #Statement 4
for i in data:
print(i)
print()
3. Report file 7
4. Project 8
5. Viva voce 3

You might also like