0% found this document useful (0 votes)
4 views

Computer-Science-Paper-2022-23-Solution

The document contains solutions to the CBSE Computer Science question paper for 2023, structured into sections A to E. It includes multiple-choice answers, programming code snippets, and explanations of concepts such as data types, database operations, and file handling. Additionally, it covers topics like wired vs wireless communication, primary and alternate keys, and various programming functions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Computer-Science-Paper-2022-23-Solution

The document contains solutions to the CBSE Computer Science question paper for 2023, structured into sections A to E. It includes multiple-choice answers, programming code snippets, and explanations of concepts such as data types, database operations, and file handling. Additionally, it covers topics like wired vs wireless communication, primary and alternate keys, and various programming functions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

 1

CBSE QUESTION PAPER SOLUTION – 2023


SUBJECT: COMPUTER SCIENCE
SECTION-A
1. True
2. (b)
3. (b)
4. (a)
5. (d)
Note :- The answer should be error as it says print(a) but a is not present in question. Assuming a
as A the answer will be option (d).

®
6. (d)
7. (a)
8. (b)
9. (d)
10. (d)
11. (a)
12. (b)
13. (c)
14. (b)
15. (b)
16. (b)
17. option (a) is correct.
18. option (a) is correct.

SECTION-B
19. def max_num (L) :
max=L(0)
for a in L :
if a > max :
max=a
return max

E
2 

20.
WIRED WIRELESS
Also called guided transmission. Also called unguided transmission.
Physical channel is involved in transmission. Signals are involved i.e. non physical channel.
Ex :- Ethernet cable. Ex :- Bluetooth Radio wave.

OR
URL Domain name
URL is a complete web address used to find a Domain name is a string in URL that identifies
particular web page. a character based internet address.
Ex : https : // www.studyemporium.com Ex : Studyemporium.com

®
URL https : ///www. studyemporium.com
domain name

21. (a) ["Rajat", "Rajan", "Ashish"]


(b) 1
22. Selected to be the primary key and the remaining are alternate keys.
Ex. :-
Primary Key Alternative keys
Adm. No. Roll. No. Name Class Stream
101 1 Atharva 12 Science
102 2 Sahil 12 Commerce
103 3 Sameer 12 Humanities
104 4 Veda 12 Commerce
Candidate keys

In the above table, Adm. no. Roll no, Name are the candidate keys out of which adm. no is the
primary key and Name and Roll. No. are the alternate keys.

23. (a) (i) HTML  Hyper text markup language


(ii) TCP Transmission control protocol
(b) Protocols are the set of rules that define how two systems communicate.
Ex. :- HTTP, TCP/IP, FTP, Telnet
Telnet helps for remote logins.
FTP defines transfer of files across internet.

E
 3

24. (a) ['CSCS', 'HINDIHINDI', 'PHYSICSPHYSICS', 'CHEMISTRYCHEMISTRY', 'MATHSMATHS']


OR
(b) 65 # 70@
25.
CHAR VARCHAR
Fixed length string Variable length string
Progressing is fast Progressing is slow
Memory wastage is there No memory is wasted
Ex. :- CREATE TABLE STUDENT Ex. :- CREATE TABLE STUDENT
(Name char (20), Gender char(20)) (Name varchar (20), Gender varchar (20))

OR

®
DDL Commands DML Commands
CREATE, ALTER, DROP INSERT, DELETE, SELECT

SECTION-C
26. (a) Rows 2 and Columns  4
(b) (i)
F_NAME CITY
SAHIL KANPUR
VEDA KANPUR
SAMEER ROOPNAGAR
MAHIR SONIPAT
MARY DELHI
ATHARVA DELHI
(ii)
DISTINCT CITY
KANPUR
DELHI
SONIPAT
ROOP NAGAR

(iii)

E
4 

F_NAME STATE
SAHIL UTTAR PRADESH
MAHIR HARYANA
ATHARVA DELHI
VEDA UTTAR PRADESH
(iv)
CITY COUNT
KANPUR 2
ROOP NAGAR 1
DELHI 2
SONIPAT 1

®
27. (a) def Longlines ( ) :
f = open ("LINES.TXT", "r")
data = f.readlines( )
for line in data :
if len (line.split( )) > 10 :
print (line)
f. close ( )
OR
(b) def count_Dwords ( )
f = open ("Details. txt", "r")
data = f. read ( ). split ( )
n=0
for word in data :
if word [–1] is digit ( ) :
n+=1
print ("Number of words ending with a digit are", n)
28. (a) (i)
MIN (PRICE) MAX (PRICE)
200 4300
(ii)
COMPANY COUNT (*)
LOGITECH 2
CANON 2
(iii)
PROD_NAME QTY_SOLD
MOUSE 2
KEYBOARD 2
JOUSTICK 1
(iv)

E
 5

PROD_NAME COMPANY QUARTER


MOUSE LOGITECH 2
LASER PRINTER CANON 1
KEYBOARD LOGITECH 2
JOYSTICK IBALL 1

(b) SHOW DATABASES;

29. def EOReplace() :


for i in range (len (L)) :
if L[i] %2 = 0
L[i] + = 1
else :
L[i] – = 1

®
print (L)
L = [10, 20, 30, 40, 35, 55]
EOReplace(L) :

30. (a) (i) Hotel = [ ]


def Push_cust (L) :
if L[1] = = "Delux" :
Hotel. append (L)
(ii) def Pop_cust( ) :
While true :
if len (Hotel) = 0 :
print ("underflow")
break
else :
print (Hotel.Pop_cust( ))
OR
(b) Vehicle = [ ]
def push (Vehicle) :
for k in Vehicle :
if Vehicle [k] = = "TATA"
Vehicle.append (k)

E
6 

SECTION-D
31. (i) BRANCH D
Reason : Branch D has maximum number of computers.
(ii) BRANCH A BRANCH B

BRANCH C BRANCH D

(iii) Hub/Switch
(iv) WAN (wide area network) as the distance is very large.
(v) FTP (file transfer protocol)

32. (a) (i)10 # 25 # 15

®
20 # 25 # 25
(b) Statement-1  mysql.connector
Statement-2  mycursor.execute ("delete from employee where E_code = "E101")
Statement-3  mydb.commit ( )
OR
(a) "N1@3"
(b) Statement-1  mysql.connector
Statement-2  mycursor.execute ("select* from employee where city = "Delhi")
Statement-3  mycursor.fetchall( )

33. (a)
CSV file TEXT FILE
 Extension  .csv  Extension  .txt
CSV Module needs to be imported  No Module needs to be imported.

(i) import csv


def COURIER_ADD ():
f = open ("courier.csv","w")
w = csv.writer (f)
cid = input ("Enter Courier ID:")
s_name = input ("Enter Sender name:")
Source = input ("Enter Source:")
Destination = input ("Enter destination:")
list = [cid, s_name, Source, destination]
w.writerow (list)
f.close ()

E
 7

(ii) def COURIER_SEARCH ():


f = open ("courier.csv","r")
data = csv.reader(f)
d = input ("Enter destination:")
if list [3] = = d:
print (list)
f.close ()
OR
(b) It is important to close a file before exiting program because data in file is not lost and
remain secure.
(i) import csv
def Add_Book ():

®
f = open ("Book.csv", "r")
w = csv.writer (f)
book_ID = input ("Enter Book ID:")
B_name = input ("Enter Book name:")
pub = input ("Enter Publisher:")
list = [book_ID, B_name, pub]
w.writerow (list)
f.close ()
(ii) def Search_Book ():
f = open ("Book.csv", "r")
data = csv. reader (f)
pub = input ("Enter Publisher Name:")
count = 0
if list [2] = = pub:
count+=1
print (list)
f.close ()
SECTION-E
34. (i) LABNO, LAB_NAME
(ii) Degree = 5
Cardinality = 5
(iii) (a) INSERT into LAB values ("L005", "SCIENCE", Venky 16, "III") :
(b) UPDATE LAB set capacity = capacity + 10 WHERE floor = 'I'
OR
(iii) (a) ALTER table LAB add constraint primary key (LABNO);

E
8 

(b) DROP LAB;

35. (i) bin_file = open ("List_file.date","ab")


(ii) qty < 10 :
(iii) Statement-3  pickle.dump(c_detail,bin_file)
Statement-4  break
OR
(iii) Statement-5  f.close( )
Statement-6  write_bin( )

You might also like