g12 RDBMS
g12 RDBMS
(SENIOR SECONDARY)
CBSE Affiliation Number 1930766
Class Test (RDMS)
GRADE:XII COMPUTER SCIENCE – 083 MAX MARKS:20
ROLL NO : ______ MAX TIME : 45 MINTS
1. Write Python code to create a table Location with the following fields: (3 m)
Id – Id of the location
bldg_code – code of the building
room – Type of rooms
capacity – capacity of the room
2. Consider the table Teacher in which Tina wants to add two rows. For this, she wrote a progeam in
which some code is missing. Help her to complete the following code. (5 m)
Import mysql.connector
Mycon=mysql.______________connect
#Line1
(host=”Localhost”,User=”root”,passwd=”system”,database=”test”)
Cursor=ccon.cursor()
Sql=”INSERT _______ Teacher(T_Id,
#Line2
Fname,Lname,Hire_dat,Salary,Subject)
VALUSE
(%s,%s,%s,%s,%s)”
________________ = [(101,’viba’,’Bajpai’,#Line3
’12-10-2021’,27000,’Python’),
(104,’Rekha’,’Sharma’,’01-01-2022’,27000,’Matha’)]
try:
cursor.executemany(sql,val)
mycon._____________() #Line4
except:
mycon.rollback()
___________________ #Line5
3. Define degree and cardinality. Based upon given table write degree and cardinality. (2 m)
PATIENTS
PatN PatName Dept DocID
O
1 Leena ENT 100
2 Supreeth Ortho 200
3 Madhu ENT 100
4 Neha ENT 100
5 Deepak Ortho 200