Q35 • CBSE 2026 • 4 Marks • Python-MySQL Connectivity (Chapter 9)
CBSE Class 12 Python-MySQL Connectivity (Chapter 9) (2026) 4-Mark Board Question Q35
Official CBSE Marking Scheme Solution
import mysql.connector
con = mysql.connector.connect(host="localhost", user="admin", password="root", database="SCHOOL")
cur = con.cursor()
cur.execute("SELECT * FROM Account WHERE Fees < 5000")
for row in cur.fetchall(): print(row)
cur.close(); con.close()

Q35 • CBSE 2025 • 4 Marks • Python-MySQL Connectivity (Chapter 9)
CBSE Class 12 Python-MySQL Connectivity (Chapter 9) (2025) 4-Mark Board Question Q35
Official CBSE Marking Scheme Solution
import mysql.connector
def Delete_Theatre():
tid = input("Enter Th_ID: ")
con = mysql.connector.connect(host="localhost", user="root", password="x2025", database="CINEMA")
cur = con.cursor()
cur.execute("DELETE FROM THEATRE WHERE Th_ID = %s", (tid,))
con.commit()
cur.close(); con.close()

Q35 • CBSE 2024 • 5 Marks • Python-MySQL Connectivity (Chapter 9)
CBSE Class 12 Python-MySQL Connectivity (Chapter 9) (2024) 5-Mark Board Question Q35
Official CBSE Marking Scheme Solution
Cartesian product pairs every row of one relation with every row of another; if they have m and n rows, the result has
m×n rows.
import mysql.connector
con = mysql.connector.connect(host="localhost", user="admin", password="Shopping", database="Keeper")
cur = con.cursor()
cur.execute("UPDATE shop SET Qty = 20 WHERE Item_code = 111")
con.commit()
Two SQL features: it is declarative/non-procedural; it supports data definition and manipulation.
import mysql.connector
con = mysql.connector.connect(host="localhost", user="root", password="airplane", database="Travel")
cur = con.cursor()
cur.execute("SELECT * FROM flight")
for row in cur.fetchall(): print(row)

Q16 • CBSE 2023 • 1 Mark • Python-MySQL Connectivity (Chapter 9)
CBSE Class 12 Python-MySQL Connectivity (Chapter 9) (2023) 1-Mark Board Question Q16
Official CBSE Marking Scheme Solution
Option B — list of tuples.

Q32 • CBSE 2023 • 5 Marks • Python-MySQL Connectivity (Chapter 9)
CBSE Class 12 Python-MySQL Connectivity (Chapter 9) (2023) 5-Mark Board Question Q32
Official CBSE Marking Scheme Solution
Statement 1: import mysql.connector as mysql
Statement 2: mycursor.execute("DELETE FROM employee WHERE E_code = 'E101'")
Statement 3: mydb.commit()
alternative
The random output is not unique: each displayed value must correspond to valid indices from M according to the randint ranges

Q4 • CBSE 2022 • 2 Marks • Python-MySQL Connectivity (Chapter 9)
CBSE Class 12 Python-MySQL Connectivity (Chapter 9) (2022) 2-Mark Board Question Q4
Official CBSE Marking Scheme Solution
fetchone() returns one row as a tuple; repeated fetchone() calls advance through the result set. The displayed output
depends on the MEMBER table values.
End of answer key. Equivalent correct Python/SQL solutions are acceptable where they achieve the stated task.
