Computer-Science-Paper-2022-23-Solution
Computer-Science-Paper-2022-23-Solution
®
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
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.
E
3
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
®
print (L)
L = [10, 20, 30, 40, 35, 55]
EOReplace(L) :
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)
®
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.
E
7
®
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;