0% found this document useful (0 votes)
15 views5 pages

Sample Paper 3 - AnswerKey

This document contains the answer key for a Class-12 Computer Science examination, detailing answers for multiple sections including true/false questions, programming tasks, and SQL queries. It provides specific answers and code snippets for each question, along with explanations for certain concepts. The answer key is structured into sections A, B, C, D, and E, covering various topics in computer science.

Uploaded by

majestic09
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)
15 views5 pages

Sample Paper 3 - AnswerKey

This document contains the answer key for a Class-12 Computer Science examination, detailing answers for multiple sections including true/false questions, programming tasks, and SQL queries. It provides specific answers and code snippets for each question, along with explanations for certain concepts. The answer key is structured into sections A, B, C, D, and E, covering various topics in computer science.

Uploaded by

majestic09
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/ 5

www.Learnpython4cbse.

com
Class-12 Subject: Computer Science (083)
Answer Key

SECTION-A
QN. Answer of Question
1. False 1
2. False 1
3. True#False 1
4. False 1
5. (b)Python. is amazing. 1
6. (c) w+ 1
7. (a) foreign key 1
8. (d) UPDATE 1
9. (b) Statement 4 1
10 (b) global p 1
.
11 (a) split() 1
.
12 (a) mango*banana*grapes 1
13 (b) SMTP 1
14 Ans. (a) 16 1
15 (d) flush() 1
16 (a) cursor.rowcount 1
17 Ans. (c) A is True but R is False 1
18 Ans: (a) Both A and R are true and R is the correct explanation for A 1
SECTION-B
19. Num=int(input("Number greater than 10 :")) 2
sum=0
for i in range(10,Num,3):
Sum+=1
if i%2==0:
print(i*2)
else:
__print(i*3)
print(Sum)
20. 1 mark for any correct advantage and disadvantage each 2
OR
Hyper Text Markup Language. Yes it has pre defined tags.
21. (a) Ans: riya riya 1
(b) dict_keys(['empname', 'address', 'salary'])
1
22. Ans. GROUP BY clause is used to get the summary data based on one or more 2
groups. The groups can be formed on one or more columns. For example, the
GROUP BY query will be used to count the number of employees in each
department, or to get the department wise total salaries.
SELECT COUNT(ENAME), SUM(SALARY), DEPT
FROM EMPLOYEES
GROUP BY DEPT;
23. (i) Post office Protocol 3 2
(ii) Voice over Internet Protocol
(b) Ans: Registered Jack-45 is used as connector to connect ethernet cable
to ethernet Port in the CPU
24. Ans: 2
20000 # 100.0
100.0 $ 200
2000 # 200.0
100.0 $ 200.0
1000.0 # 100.0
100.0 $ 200.0
OR

Ans:
(‘Python’)
6
3
25. Ans. Where” clause is used to filter the records from a table 2
that is based on a specified condition, then the “Having” clause
is used to filter the record from the groups based on the
specified condition. OR

Ans. Aggregate function are group functions which works on group of


rows. Examples are sum(), min(), max(), avg(), count() etc.
SECTION-C
26. a) 1+2
Name Dept
Lakshya Computer
Ravi Physics
Neeraj Sports
Brijesh English

b)

(i) Vice principal 1

(ii) YASHRAJ
UMESH

27. Ans: 3
def beginA():
f=open(‘Notebook.TXT’)
l=f.readlines()
for i in l:
if i[0]==’A’ or i[0]= =’a’:
#or if i[0] in [“A”,”a’]
print(i)
f.close()
OR
fr=open(“PYTHON.TXT”)
fw=open(“PYTHON1.TXT”, ‘w’)
d=fr.read()
for i in d:
if not i.isdigit():
fw.write(i)
fr.close()
fw.close()
½ marks each for correct piece of code
28. Ans. (a) 3
i) Give 1 mark each correct output
SPORTS MIN(PAY)
Karate 1000
Squash 2000
Basketball 1500
Swimming 750
ii) Give 1 mark each correct output
MAX(DATEOFAPP), MIN(DATEOFAPP)
24/02/1998 27/03/1996

iii) Give 1 mark each correct output


CNAME PAY C.COACHID SPORTS
TARUN 1500 4 BASKETBALL
SHAILYA 1700 10 BASKETBALL

iv) Give 1 mark each correct output


SNAME CNAME
ANUJ KATAKI
b) Show databases;
29. def shiftn(L,n): 3
return L[n:]+L[:n]
30. visitors=[['305', '10/11/2022', 'Geeta','F', 15],['306', '10/11/2022', 'Arham','M', 3
15],\['307', "11/11/2022", 'David','M', 18],['308', "11/11/2022", 'Madhuri','F',
17]]
status=[]
def Push_Element(visitors):
global status
for i in visitors:
if i[4]>=15 and i[4]<=20:
status.append(i[3])

def Pop_Element():
global status
m,f=0,0
if status!=[]:
r=status.pop()
if r== ‘F’:
f+=1
else:
m+=1
else:
print(“Female :”,f)
print(“Male :”,m)
print("Done")

OR
def Push(EventDetails):
BigEvents=[]
count=0
for i in EventDetails:
if EventDetails[i]>200:
BigEvents.append(i)
count+=1
print(“The count of elements in the stack is”,count)
SECTION-D
31. Ans. (i) HR because it has maximum number of computers 5*1
(ii) Star topology with HR at centre (any appropriate block diagram)
(iii) Switch need to be installed in each of the block repeater where distance is
greater than 100m
(iv) VoIP
(v) WAN
32. Ans. (a) 2+3
10 # 5
10 # 10
20 # 10
20 # 20

Ans: (b)
Statement 1:
con.cursor()
Statement 2:
mycursor.execute(query)
Statement 3:
con.commit()
OR

Ans. (a) gIiE# E#A#GgAas# F# AaEe#


Ans. (b)
Statement 1: con.cursor()
Statement 2: mycursor.execute(“select Name from items where price>100”)
Statement 3: mycursor.fetchall()
33. (a) Advantage of a csv file: 2+3
It is human readable – can be opened in Excel and Notepad applications
It is just like text file
(b) ½ marks for each correct piece of code.

OR
Ans: Difference between binary file and csv file: (Any one difference may be
given) Binary file:
Binary csv
Extension is .dat Extension is .csv
Not human readable Human readable
Stores data in the form of 0s and 1s Stores data like a text file
CSV file

Program:
import csv
def add():
fout=open("empdata.csv","a",newline='\n')
wr=csv.writer(fout)
fid=int(input("Enter Emp Id :: "))
fname=input("Enter Emp name :: ")
fprice=int(input("Enter psalary :: "))
FD=[eid,ename,salary]
wr.writerow(FD)
fout.close()
def search():
fin=open("furdata.csv","r",newline='\n')
data=csv.reader(fin)
found=False
print("The Details are")
for i in data:
if int(i[2])>10000:
found=True
print(i[0],i[1],i[2])
if found==False:
print("Record not found")
fin.close()
add()
print("Now displaying")
search()
SECTION-E
34. Ans. (i) ItemNo 1+1
(ii) Cardinality=3 and Degree=9 +2
(iii)
a) Insert into items values (2024, ‘point pen’, 20, 11, 350, ‘2022-NOV-15’);
b) Update items
Set rate=rate+(rate*0.02)
Where Item like ‘%c’;
OR
iii) Delete From items where rate>=10;
b) Alter table items Add column (Remarks Varchar(50));

35. (i) pickle 1


(ii) fout=open(‘extra.dat’, ‘wb’) 1
(iii) pickle.load(fin) 1
(iv) pickle.dump(rec,fout) 1

You might also like