12th Standard CBSE Syllabus & Materials
12th 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
NEW12th 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

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

SECTION - A (Multiple Choice Question)
1.
Which switching technique follows the store and forward mechanism?
Circuit
Message
Packet
All of these
2.
1 Gbps is equal to
125 Mbps
125 Bps
125 Kbps
125 Gbps
3.
Which of the following is not a network device?
Modem
Hub
Switch
Satellite
4.
Which topology is based on a central which act as a hub :
Star topology
Bus topology
Tree topolog
Hybrid topology
5.
Which of the following is used to control the traffic between computer networks?
Firewall
Cookies
Virus
Worms
6.
What is the expanded form of XML?
Extended Markup Language
Extensible Markup Language
Extra Markup Language
None' of these
7.
Which of the following is not a server side script?
ASP
JSP
PHP
VB Script
8.
Mozilla is a free internet software that includes
web browser
email client
HTML editor
All of these
9.
Which method is used to retrieve the executed database function or stored procedure result in Python?
cursor.stored_ results()
cursor.get_ results()
cursor.fetchresults()
cursor.show results()
10.
Mandatory arguments required to connect any database from Python
Username, Password, Hostname, Database Name,Port.
Username, Password, Hostname.
Username, Password, Hostname, Database Name.
Username, Password, Hostname, Port.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
SECTION - B (2 Marks)
22.
Define the following:
(i) Firewall (ii) VOIP
23.
What is the difference between packet and message switching?
24.
Give any two advantages of using optical fibre.
25.
Write one advantage of bus topology of network. Also illustrate how four (4) computers can be connected with each other using bus topology of network.
26.
Explain the purpose of a router.
27.
Identify the type of topology from the following:
(i) Each node is connected with the help of a single cable.
(ii) Each node is connected with the help of independent cable
with central switching.
28.
Name the protocol
(i) Used to transfer voice using packet switched network.
(ii) Used for chatting between two groups or between two individuals.
29.
List the most common parameters and the usage that are passed to communicate with the database.
30.
Given a database Inventory, user id- store manager password - welcometostore123
Write Python code to connect to the above database.
31.
Consider a table structure as follows:
Employee
Emp_Id
Emp_name
Dept
Age.
Write Python code to create the above table and then create an index as Emp_Id.
SECTION - D (4 Marks)
32.
ABC Pvt. Ltd. is setting up the network in the Bengaluru. There are four departments named as
Market, Finance, legal and Sales.
Distance between various buildings is as follows:
| Market to Finance | 80 mt |
| Market to Legal | 180 mt |
| Market to Sales | 100 mt |
| Legal to Sales | 150 mt |
| Legal to Finance | 100 mt |
| Finance to Sales | 50 mt |
Number of computers in the building:
| Market | 20 |
| Legal | 10 |
| Finance | 08 |
| Sales | 02 |
(i) Suggest a cable layout of connections between the Departments and specify the typology.
(ii) Suggest the most suitable building to place the server by giving suitable reason.
(iii) Suggest the placement of (i) modem (ii) hub/ switch in the network.
(iv) The organization is planning to link its sale counter situated in various part of the same city. Which type of network out of LAN, WAN, MAN will be formed? Justify
33.
Perfect Edu Services Ltd. is an educational organization. It is planning to setup its India campus at Karnataka with its head office at Delhi.
The Karnataka Campus has 4 main buildings - ADMIN. ENGINEERING, BUSINESS and MEDIA.
You as a network expert have to suggest the best network related solutions for their problems raised in (i) to (iv), keeping in mind the distances between the buildings and other given parameters. Shortest distances between various buildings:
| Admin to Engineering | 55 mt |
| Admin to Business | 90 mt |
| Admin to Media | 90 mt |
| Engineering to Business | 55 mt |
| Engineering to Media | 90 mt |
| Business to Media | 45 mt |
| Delhi Head office to Karanatakacampus | 2175 km |
Number of computers installed at various buildings are as follows:
| Admin | 110 |
| Engineering | 75 |
| Business | 40 |
| Media | 12 |
| Delhi Head office | 20 |
(i) Suggest the most appropriate location of the server inside the Karnataka campus to get the best connectivity for maximum no. of computers.
(ii) Draw the cable layout to efficiently connect various buildings within the Karnataka campus for connecting the computers.
(iii) Which hardware device will you suggest to be procured by the company to be installed to protect and control the internet uses within the campus?
(iv) Which of the following will you suggest to establish the online face to face communication between the people in the admin office of Karnataka campus and Delhi Head office.
34.
Uplifting Skills Hub India is a knowledge and skill community which has an aim to uplift the standard of knowledge and skills in the society. It is planning to setup its training centres in multiple towns and villages pan India with its head offices in the nearest cities. They have created a model of their network with a city, a town and 3 villages as follows.
As a network consultant, you have to suggest the best network related solutions for their issues/ problems raised in (i) to (iv) keeping in mind the distance between various locations and given parameters.
Shortest distance between various location:
| VILLAGE 1 to B TOWN | 2km |
| VILLAGE 2 to B TOWN | 1.0km |
| VILLAGE 3 to B TOWN | 1.5km |
| VILLAGE 1 to B VILLAGE 2 | 3.5km |
| VILLAGE 1 to B VILLAGE 3 | 4.5km |
| VILLAGE 1 to B VILLAGE 3 | 2.5km |
| A CITY Head Office to B HUB | 25km |
Number of Computers installed at various locations are as follows:
| B TOWN | 120 |
| VILLAGE 1 | 15 |
| VILLAGE 2 | 10 |
| VILLAGE 3 | 15 |
| A_CITY Head OFFICE | 6 |
Note :
1. In Villages, there are community centres, in which one room has been given as training centre to this organization to install computers. The organization has got financial support from the government and top IT companies.
(i) Suggest the most appropriate location of the SERVER in the B-HUB our of the 4 locations), to get the best and effective connectivity. Justify your answer.
(ii) Suggest "the best wired medium and draw the cable layout (location to location) to efficiently connect various locations within the B_HUB.
(iii) Which hardware device will you suggest to connect all the computers within each location of B_HUB?
(iv) Which service/protocol will be most helpful to conduct live interactions of Experts from Head Office and people at all locations of B_ HUB?
35.
Rovenza Communications International (RCI) is an online corporate training provider company for IT related courses. The company is setting up their new campus in Kolkata. You as a network expert have to study the physical locations of various blocks and the number of computers to be installed. In the planning phase, provide the best possible answers for the queries (i) to (iv) raised by them.
| From | To | Distance |
| Administrative Building Administrative Building Finance Building |
Finance Building Faculty Studio Building Faculty Studio Building |
60 120 70 |
Expected computers to be installed in each block
| Building | Computers |
| Administrative Building | 20 |
| Finance Building | 40 |
| Faculty Studio Building | 120 |
(i) Suggest the most appropriate block, where RCI should plan to install the server.
(ii) Suggest the most appropriate block to block cable layout to connect all three blocks for efficient communication.
(iii) Which type of network out of the following is formed by connecting the computers of these three blocks?
i) LAN
ii) MAN
iii) WAN
(iv).Which wireless channel out of the following should be opted by RCI to connect to students from all over the world?
i) Infrared
ii) Microwave
iii) Satellite
36.
Consider the following table Emp
| Emp NO | Emp Name | JOB | Mgr | Hiredate | Sal | Dept NO |
| 7839 | Magesh | President | 7872 | 17-11-01 | 5000 | 10 |
| 7698 | Krishna | Manager | 7839 | 01-5-81 | 2600 | 25 |
|
7872 |
Anubhav | Manager | 7839 | 31-3-83 | 2700 | 30 |
| 7566 | Siddhant | Manager | 7839 | 23-6-82 | 2650 | 15 |
| 7564 | Arnav | Asst .Manager | 7698 | 18-7-81 | 1000 | 25 |
| 7560 | Khyati | Receptionist | 7872 | 21-2-84 | 1000 | 30 |
Write Python code to insert 2 records with suitable data in the above table taking system date as Hiredate.
37.
Consider the table Product with following structure.
P_ID, ProductName, Manufacturer, Price.
Write Python code to increase price of all products by 50.
SECTION - C (3 Marks)
38.
Write Python code to create a table Faculty with following fields.
Id, LastName, FirstName, LocationId, phone, rank, startdate
Rank should be one of the following
ASSO, FULL,ASST, INST
39.
Create following table using Python code.
Table Name = Customer
Database - xyzcorp
Userid - Adminxyz
Password - Axydm12
| CUST NUMB | CUST NAME | ADDRESS | BALANCE | CREDLIM | SLSRNUMB |
| 124 | TINA ADAMS | 481Tilaklane CP ,Delhi |
41800.75 | 50000 | 3 |
| 256 | R VENKAT | 215 Mylapore Chennai | 100000.75 | 80000 | 6 |
| 567 | BHUVANA BALAJI | 808,Bala Nagar Hyderabad |
57000.75 | 50000 | 6 |
| 622 | PRATHAM JAIN | 149,Plot 182, sec -9 Dwarka ,Delhi |
57500.75 | 80000 | 12 |
40.
Write Python code to insert following records into the OrderDetails table.
Database \(\rightarrow\)sales
Userid \(\rightarrow\) Admin
Password \(\rightarrow\) salAd345
table name \(\rightarrow\) OrderDetails
| ORDNUMB | PARTNUMB | NUMBORD | QUOTPRIC |
| 12489 | AX12 | 11 | 14.95 |
| 12491 | BT04 | 1 | 402.99 |
| 12492 | BZ66 | 1 | 311.95 |
| 12498 | CX11 | 2 | 57.95 |
41.
Write a Python code to insert following records into table Orders as follows
Database \(\rightarrow\)Sales
userid \(\rightarrow\) salesman1
password \(\rightarrow\) sale1
table \(\rightarrow\) orders
| ORD NUMB | CUST NO | ORDDTE |
| 12489 | 124 | 01-03-98 |
| 12491 | 311 | 10-03-98 |
| 12495 | 315 | 31-03-98 |
| 12498 | 522 | 10-04-98 |
42.
Consider the following table OrderDetails of database sales
| ORDNUMB | PARTNUMB | NUMBORD | QUOTPRIC |
| 12494 | CB03 | 4 | 175.00 |
| 12495 | CX11 | 2 | 57.95 |
| 12498 | AZ52 | 2 | 22.95 |
| 12500 | BT04 | 1 | 402.99 |
Write Python code to increase NUMBORD by 5 if QUOTPRIC is less than 100 or NUMBORD is greater than 3.
43.
Consider the tables Product and Client with structures as follows:
| Product | Client |
| P_ID | C_ID |
| ProductName | CName |
| Manufacturer | CCity |
| Al Price | CProd |
Write Python codes for the following
(a) To display the details of these client whose city is Delhi.
(b) To display the details of products whose price is in range of 50 to 100 (Both values included)
(c) To display the Client Name, City from table Client
(d) To display the price of all the items by the manufacturer 'ABC'.
(e) To display product name and 4 times its price from the Product table.
SECTION - E (5 Marks)
44.
45.
46.
47.
SECTION - A (Multiple Choice Question)
1.
(b)
Message
2.
(a)
125 Mbps
3.
(d)
Satellite
4.
(a)
Star topology
5.
(a)
Firewall
6.
(b)
Extensible Markup Language
7.
(d)
VB Script
8.
(d)
All of these
9.
(a)
cursor.stored_ results()
10.
(c)
Username, Password, Hostname, Database Name.
11.
(c)
12.
(c)
13.
(a)
14.
(a)
15.
(c)
16.
(d)
17.
(b)
18.
(b)
19.
(a)
20.
(a)
21.
(b)
SECTION - B (2 Marks)
22.
Firewall: A system designed to prevent unauthorized access to or from a private network is called firewall. It can be implement in both hardware and software or combination of both.
VOIP: It is a methodology and group of technologies for delivering voice communications and multimedia sessions over IP networks, such as the Internet
23.
| Packet switching | Message switching |
| (i) There is a tight upper limit on the block size. A fixed size of packet is specified. |
(i) In message switching, there was no upper limit. |
| (ii) All the packets are stored in main memory in switching office. | (ii) In message switching, packets are store on disk.This increases the performance as access. |
24.
Two advantages of using optical fibres are:
(i) Capable of extremely high speed.
(i) No electromagnetic interference.
25.
Advantage of Bus topology is that the cable length required for this topology is the least compared to the other networks.
26.
A router establishers connection between two networks and it can handle network with different protocols. Using a routing table, routers make sure that the data packets are traveling through the best possible paths to reach their destination
27.
(i) Bus Topology
(ii) Star Topology
28.
(i) VOIP [VoiceOver Internet Protocol]
(ii) IRC [Internet Relay chat]
29.
| 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 |
30.
import MySQLdb
try:
db=MySQLdb.connect( ('localhost' .storemanager' ,'welcometostore123' .Tnventory')
print "connected to the database"
except:
print "unable to connect to the database"
31.
import MySQLdb
db = MySQLdb.connect('localhost' ,'HRMan','HRman@pwd','compvtLtd')
cursor=db, cursor()
cursor.execute("Drop Table Employee")
sql="""Create Table Employee(' Emp_id' INT
NOTNULL, 'Empriarne' char(50) NOTNULL,
'Dept' char(20)
NOTNULL, 'Age' INT NOTNULL)"""
cursor.execute(sql)
cursor.execute("""create index eid on
user, (Emp_Id)'''''')
cursor.commit()
cursor.close()
db.close()
SECTION - D (4 Marks)
32.
Star topology should be used.
(ii) Sales is the most suitable building to place the server because it has maximum no. of computers.
(iii) Each building should have hub/switch and modern in case Internal connection is required.
(iv) MAN(Metropolitan Area Network) as this network can be carried out in a city network.
33.
(i) Admin (Due to maximum number of computers)
(iii) Firewall or Router
(iv) Cable TV
34.
(i) B-TOWN can house the server as it has the maximum no. of computers.
(ii) Optical fibre cable is the best for this star topology.
(iii) Switch
(iv) VoIP
35.
(i) Faculty studio building.
(ii) Star topology
(iii) LAN
(iv) Satellite connection
36.
import MySQLdb
db =MySQLdb.connect('localhost', 'HRMAN','Adminespwd', 'cosmetics')
cursor = db.cursor(prepared = TRUE)
sql = "''''Insert into table('EmpNo', 'EmpName','Job', 'Mgr', 'Hiredate', 'Sal', "DeptNo.")
values('%s', '%s', '%s', '%s', '%s', '%f, '%s')"""
current_ date = datetime.now()
Form_date = currencdate.strftime('%d-%m-%y')
insert_value = [('7369', 'Smith', 'Clerk', '7839',
currentdate.800, NULL),
('7788', 'Scott', 'Analyst', '7566',current date, 3000, 15)]
try:
cursor.executemany(sql 1, insert_value)
print(cursor.rowcount, "Records inserted")
db.commit()
except:
db. rollback ()
cursor.close()
db.close()
37.
db MySQLdb.connect('localhost', 'PId' "PID@pwd', 'sales')
cursor = db.cursor()
sql = """Update Product set Price = Price-Su?"
try:
cursor.execute(sql)
db.commit()
except:
db.rollback()
cursor.close()
db.close()
SECTION - C (3 Marks)
38.
import MySQLdb
db=MySQLdb.connect("localhost", "Fac", "Fac24", "Instds")
cursoredb.cursor()
cursor.execute("DROP TABLE IF EXISTS FACULTY")
sql="""Create Table Faculty(Id Number(3) PRIMARY KEY,LastName CHAR(30) NOT NULL, FirstName CHAR(30) NOT NULL,
LocationId Number(5), phone char(10), rank char(4) check (rank IN('ASSO','FULL', 'ASST', 'INST'))' startdate DATE)"""
cursor.execute(sql)
db.close()
39.
Import MySQLdb
db=MySQLdb.connect("localhost", "Adminxyz", "Axydrn l?", "xyzcorp")
cursor=db.cursor()
cursor.execute("DROP TABLEIF EXISTS CUSTOMER")
sql="""Create Table Customer (CUSTNUMB CHAR(3) NOTNULL, CUSTNAME CHAR(60) NOT NULL,
ADDRESS CHAR(100), BALANCE Float, CREDLIM Float, SLSRNUMB CHAR(2) NOT NULL)"""
cursor.execute(sql)
cursor.close()
rec_ins=[('124', 'TINA ADAMS', '481 Tilak lane, CP, Delhi', 41800.75,50000, '3'),
('256', 'R VENKAT', '215 Mylapore, Chennai', 100000.75, 80000,'6')'
('567', 'BHUVNA BALAJI', '808 BalaNagar, Hyderabad', 57000.75, 50000,'6')
('622', 'PRATHAMJAIN', '149 Plot 182, sec-9 Dwarka,Delhi', 57500.75,80000, '12')]
sql jnsert- """INSERT INTO Customer (CUSTNUMB, CUSTNAME, ADDRESS, BALANCE, CREDLIM ,
SLSRNUMB), (VALUES('%s', '%s', '%s', '%f, '%f, '%s')"""
cursor=db. cursor(prepared=TRUE)
try:
cursor. executemany(sql_insert, rec_ins)
print(cursor.rowcount, "Records inserted successfully")
db.commit()
except:
db.rollback()
cursor.close()
db.close()
40.
import MySQLdb
db=MySQLdb.connect('localhost', 'Admin', 'saIAd345', 'sales') cursoredb.cursortprepared-True)
insert_query= ''''''INSERT INTO TABLE (ORDNUMB, PARTNUMB, NUMBORD, QUOTPRIC) VALUES('%s','%s ','%s','%f ')"""
rec_ins=[('12489', 'AXI2', '11', 14.95), ('12491', 'BT04', '1' '402.99), ('12492', BZ66', '1',311.95), ('12498', 'cxn. '2', 57.95)]
try:
cursor.executemanytinsert..query, rec_ins)
print(cursor.rowcount, "Records inserted successfully")
db.commit()
except:
db.rollback()
cursor.close()
db.close()
41.
import MySQLdb
db=MySQLdb. connect('localhost', 'salesman 1', 'sale 1', 'Sales ')
cursor=db. cursor(prepared = TRUE)
sql_query="""INSERT INTO Orders (ORDNUMB, CUSTNO, ORDDTE) VALUES ('%s', '%s', '%s')"''''
rec_inst=[('12489', '124', '01-03-98'), ('12491', '311', '10-03-98'), ('12495', '315', '31-03-98'),
('12498', '522', '10-04-98')]
try:
cursor.executemany(sql_query, rec_inst)
print(cursor.rowcount, "Records inserted successfully")
db.commit()
except:
db.rollback()
cursor.close()
db.close()
42.
import MySQLdb
db=MySQLdb.correct('localhost', 'Admin','SalA345', 'sales')
cursor=db. cursor()
sql="""UPDATE OrderDetails set
NUMBORD=NUMBORD+5 where QUOTPRIC
<'%d' OR NUMBORD> '%d'"''''
check_value = (100,3)
try:
db.execute(sql, checkvalue)
db.commit()
except:
db.rollback()
db.close()
43.
(a) import MySQLdb
db=MySQLdb.connect('localhost', 'Admin','Admin@pwd', 'cosmetics')
cursor=db.cursor()
sql=''''''Select*from Client where city=%s"""
city _query=('Delhi')
try:
cursor.execute(sql, city_query)
results = cursor.fetchall()
print ("Client ID, Name, City, Product")
for row in results:
CID = row[0]
CName = row[1]
CCity = row[2]
CProd = row[3]
prints ("%s %s %s %s" % \ (CID, CName,CCity, CProd)
except:
print ("Error: unable to fetch data")
cursor. close()
db.close()
(b) import MySQLdb
db=MySQLdb.connect('localhost', 'Admin','Admin@pwd', 'cosmetics')
cursoredb.cursor()
sql="""select * from Product where Price
BETWEEN %F to %F"""
value = (50,100)
try:
cursor.execute(sql, value)
results = cursor.fetchall()
print ("ID ProductName Manufacturer Price")
for row in results:
PID = row[0]
PName = row[l]
PManu = row[2]
PPrice = row[3]
print (" %s %s %s %s", % \ (PID, PName,PManu, PPrice)
print (cursor.rowcount, "Records Found")
except:
print ("Error unable to Fetch data")
cursor.close()
db.close()
(C )import MySQLdb
db = MySQLdb.connect('localhost', 'Admin','Admin@pwd', 'cosmetics')
cursor=db.cursor()
sql="""select ClientName, City From Client"""
try:
cursor.execute(sql)
results = cursor.fetchall()
print "ClientName","City"
for row in results:
print "%s %s", % \ (row[0], row[l])
print (cursor.rowcount, "RecordsFound")
except
print ("Error unable to Fetch data")
cursor.close()
db.close()
(d) import MySQLdb
db = MySQLdb.connect('localhost', 'Admin','Admin@pwd', 'cosmetics')
cursor=db. cursor(buffered=TRUE)
sql="""select price From Product where
Manufacturer = %s"""
query _value= ('ABC',)
try:
cursor.execute(sql, query_value)
results = cursor.fetchall()
print "Price of Items by %s", % \ (query_value)
for row in results:
print row[0]
print (cursor.rowcount, "Items listed")
except:
print ("Error unable to Fetch data")
cursor.close()
db.close()
(e) import MySQLdb
db MySQLdb.connect('localhost', 'Admin','Adminespwd', 'cosmetics')
cursor = db.cursor()
sql = """Select ProductName, Price *4 From Product'?"
try:
cursor.execute(sql)
results = cursor.fetchall()
print ("ProductName","Price")
for row in results:
print ("%s %s" % \ (row[0]. row[1]))
print (cursor.rowcount, "Records found")
except:
print ("Unable to fetch data")
cursor.close()
db.close()
SECTION - E (5 Marks)
44.
45.
46.
47.
12th Standard CBSE Syllabus & Materials
12th 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
NEW12th Standard CBSE
CBSE 12th Chemistry Chemical Kinetics Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Chemistry Electrochemistry Important Questions And Answers Study Material - QB365 Set C
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