12th Standard CBSE Syllabus & Materials
12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Important Questions And Answers Study Material - QB365 Set B
NEW12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Assertion and Reason Study Material - QB365 Set D
NEW12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Assertion and Reason Study Material - QB365 Set C
NEW12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Assertion and Reason Study Material - QB365 Set B
NEW12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Assertion and Reason Study Material - QB365 Set A

Published on: 25/10/2025
Download CBSE Class 12th Standard CBSE Computer Science question papers, sample papers, important questions, and previous year solved papers in PDF format. Get free study materials, NCERT solutions, and exam preparation resources for Class 12th Standard CBSE Computer Science
Questions + Answers key
Take MCQ Computer Science Test

2 Marks
1.
What is relation? Define the relational data model.
2.
Differentiate between cardinality and degree of a table with the help of an example.
3.
Observe the following table carefully and write the names of the most appropriate columns, which can be considered as
(i) candidate keys and (ii) primary key
| Id | Product | Qty | Price | Transaction Date |
| 101 104 105 109 103 |
Plastic Folder12" Pen stand standard Stapler Medium Punching Machine Big Stapler Mini |
100 200 250 200 100 |
3400 4500 1200 1400 1500 |
2014-12-14 2015-01-31 2015-02-28 2015-03-12 2015-02-02 |
4.
Define degree and cardinality. Based upon given table write degree and cardinality.
Patient
| PatNO | ParName | Dept | DocID |
| 1 2 3 4 5 |
LEENA SUPREETH MADHU NEHA DEEPAK |
ENT Ortho ENT ENT Ortho |
100 200 100 100 200 |
5.
Observe the following table and answer the parts (i) and (ii):
Table: store
| ITEM CODE | ITEMS | OTY | RATE |
| 10 11 12 13 15 |
Gel Pen classic Sharpener Ball Pen 0.5 Eraser Ball Pen 0.25 |
1150 1500 1600 1600 800 |
25 |
(i) In the above table, can we have Qty as primary key. [Answer as Yes/No.].Justify your answer.
(ii) What is the cardinality and degree of the above table?
6.
List the most common parameters and the usage that are passed to communicate with the database.
7.
Consider the tables FACULTY and COURSES with structure as follows
| FACULTY | COURSES |
| F _ ID | C _ ID |
| FName | F _ID |
| LName | Cname |
| Hiredate | Cname |
| Salary | Fees |
Write Python codes for the following.
(a) To display details of these faculties whose salary is greater than 12000
(b) To display the details of courses whose fees is in the range of 15000 to 50,000 (both values included)
(c) To increase the fees of course "System Design" by 500
(d) To display the count of unique F_ID from courses table.
8.
Consider the following table structure of table Hospital.
Hospital
Hospital_ id(p)
Hospital_name
Bed_Count
Write Python code to create the above table structure
9.
Consider the structure of table Doctor given below
Doctor
Doctor_id(p)
Doctor _Name
Hospital_id(F)
Joining_Date
Specialty
Salary
Experience.
Write Python code to create the above table.
10.
Differentiate between Primary key and Candidate key.
11.
Sonal needs to display name of teachers, who have "O" as the third character in their name.
She wrote the following query.
SELECT NAME FROM TEACHER WHERE NAME = "**O?";
But the query isn't producing the result. Identify the problem.
2 Marks
1.
A relation is a table having atomic values, unique row and unordered rows and columns. The relational model represent data and relationship among data by a collection of tables known as relation, each of which has a number of columns with unique names.
2.
Cardinality is defined as the number of rows in a table. Degree is the number of columns in a table.
e.g. consider the following table:
Table: Account
| Acno | Cname |
| A 101 A 102 A 103 |
Rahul Riya Darsh |
Cardinality: 3
Degree : 2
3.
Candidate keys: Id, Product
Primary key: Id
4.
Degree is the number of attributes or columns present in a table.
Cardinality is the number of tuples or rows present in a table.
Degree: 4
Cardinality: 5
5.
(i) We cannot use Qty as primary key because there is a duplication of values and primary key value cannot be duplicate.
(ii) Degree: 4
Cardinality: 5
6.
| Parameter | Usage |
| Dsn | Data source name. This usually includes the name of your database and the server where it is running. |
| Host | Host, or network system name, on which the database runs. |
| Database | Name of the database |
| User | User name for connecting to the database |
| Password | Password for the given user name |
7.
(a) import MySQLdb
db = MySQLdb.connect('localhost' ,'FacAdmin','FacAdmin@pwd','college')
cursor=db.cursor()
sql="""select* from Faculty where salary>%F""",
search_ value=(12000,)
try:
cursor.execute(sql.search_ value)
result=cursor. fetchall()
print("ID, Name, Hiredate")
for row in result:
ID=row[0]
name-row[1]-" "row[2]
Hiredate=row[2]
print (ID,name, Hiredate)
print cursor.rowcount, "Records found"
except:
print ("Error: can't Fetch records")
cursor.close()
db.close()
(b) import MySQLdb
db=MySQLdb. connect('localhost' ,'FacAdmin','FacAdmin@pwd','college')
cursor=db.cursor()
sql="""select * from courses where Fees between %F and %F"""
search_value=(15000,50000)
try:
cursor.execute(sql, search_value)
results = cursor.fetchall()
print ("CID Faculty Course Fee")
for row in results:
print (row[0],row[1], row[2], row[3])
print (cursor.rowcount, "Records Found")
cursor.close()
db.close()
(c) import MySQLdb
db=MySQLdb.connect('localhost' ,'FacAdmin','
FacAdmin@pwd','college')
cursor = db.cursor()
sql= Update Courses set Fees = Fees+500
where Cname=%s"''''
update value = ('System Design',)
try:
cursor.execute(sql, update_value)
db.commit()
print (cursor.rowcount, "record updated")
except
db. rollback.
cursor.close()
db.close()
(d) import MySQLdb
db = MySQLdb.connect('localhost' ,'FacAdmin',"FacAdmin@pwd',' college')
cursor=db.close()
sql="""select count (Distinct F_ID) from Courses"""
try:
cursor.execute(sql)
print (row[0], "unique F_ID exist")
except:
print ("Error could not Fetch records")
cursor.close()
db.close()
8.
import MySQLdb
db = MySQL.connection('localhost' ,'FacAdmin','FacAdmiil@123','XYZHOS')
cursoredb.cursor()
cursor.execute("DROP TABLE IF EXISTS Hospital")
sql="""Create Table Hospital('Hospital _ id',
INT NOTNULL, 'Hospital_name' CHAR(50)
NOTNUL
'Bed_Count' INT, PRIMARY KEY ('Hospital_id')
)"""cursor.~xecute(sql)
cursor.elose()
db.close()
9.
import MySQLdb
db = MySQLdb.connect('localhost' ,'HosAdmin','HosAdmin@123' ,'XYZHospital')
cursor=db.cursor()
cursor.execute("DROP TABLE IF EXISTS DOCTORS")
sql="""Create Table Doctors (,DoctocId' INT NOTNULL, 'Doctor_Name' Char(50) NOTNULL, 'HospitalId' INT NOTNULL, 'Joining Date' Date NOTNULL, 'Speciality' char(50), 'Salary'
Float' 'Experience' Float PrimaryKey
(Doctor_ Id,))"""
cursor.execute(sql)
cursor.close()
db.close()
10.
A Candidate Key can be any column or a combination of columns that can qualify as unique Key in database. There can be multiple Candidate keys in one table. Where as A Primary Key is a column or a combination of columns that uniquely identify a record. There can be only one primary key in one table
Degree: It is the total number of attributes (number of columns) in the table.
Cardinality: It is the total number of tuples (number of rows) in the table.
11.
The wildcards are incorrect. The corrected query is SELECT NAME FROM TEACHER WHERE NAME LIKE' _ _ 0%';
12th Standard CBSE Syllabus & Materials
12th Standard CBSE
CBSE 12th Standard Biology Sexual Reproduction in Flowering Plants Sample Question Papers Study Material - QB365 Set 1
NEW12th Standard CBSE
CBSE 12th Chemistry d- and f- Block Elements Important Questions And Answers Study Material - QB365 Set B
NEW12th Standard CBSE
CBSE 12th Chemistry d- and f- Block Elements Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Chemistry Chemical Kinetics Important Questions And Answers Study Material - QB365 Set B
NCERT Books
Syllabus
Exam Pattern
Sample Question Papers
Previous year Question Papers
Important Notes
MCQ Practice test
NCERT Exemplers
Case study Questions
Image Based Questions
Passage based Questions
HOT Questions
Value Based Questions
Model Questions Papers
NCERT ( Book Back ) Questions
Assertion and Reason
Important Questions And Answers
CBSE 12th Standard CBSE Subjects
CBSE Standards