Preboard Class12 ComputerScience Key
Preboard Class12 ComputerScience Key
1. False
2. c. 512
3. a. In Python, explicit data type conversion is impossible
4. b. List
5. b. COMPUTER-Students-are-very-SMART
6. b.
(4, 5, 6, 4, 5, 6)
(4, 5, 6, 4, 5, 6, 4, 5, 6)
7. b. (['salary', 'dept', 'age', 'name'])
8. a. ('', ' ', 'Azadi Ka Amrit Mahotsav @ 2022')
9. a. update
10. b. seek()
11. False
12. c. 5#5
13. c. A view of existing column with different name
14. a. Aggregate functions ignore NULL
15. c. Join
16. c. Cardinality
17. c. PAN
18. a. Micro waves
19. b. Modulator
20. b. Both A and R are true and R is not the correct explanation for A
21. a. Both A and R are true and R is the correct explanation for A
Section-B (7 x 2 = 14 Marks)
22.
a.@50 otnmx ROEP@ (1 mark for the correct answer)
b. dict_items([('name', 'Aman'), ('age', 27), ('address', 'Delhi')])
(1 mark for the correct answer)
24. i. L1.pop(1)
ii. L1.insert(1, 'orange')
OR
import statistics
print( statistics.mode(studentAge) )
25. Maximum value of SEL is 3 and minimum is 1
1|Page
2
28.
OR
WEBSERVER:
A web server is a computer that runs websites. It's a computer program that distributes
web pages as they are requisitioned. The basic objective of the web server is to store,
process and deliver web pages to the users. This intercommunication is done using
Hypertext Transfer Protocol (HTTP).
WEB BROWSER:
The web browser is the software application used to access resources on the internet. E.g.
Chrome, Firefox, Internet Explorer etc.
(1 mark each for correct difference)
2|Page
3
Section-C ( 3 x 3 = 9 Marks)
29.
def count_Dwords():
f=open("details.txt","r")
s=f.read()
w=s.split()
count=0
for c in w:
if c[-1].isdigit():
count=count+1
print("Number of words ending with a digit are",count)
OR
def count_word():
file = open('india.txt','r')
count = 0
for line in file:
words = line.split()
for word in words:
if word == 'India':
count += 1
print(count)
file.close()
# call the function count_word(). count_word()
30.
OR
3|Page
4
32.
(i) select PROD_NAME, QTY_SOLD from computer c, sales s
where c.PROD_ID = s. PROD_ID ;
(ii) desc computer;
(iii) drop table sales;
(iv) select QUARTER , sum( QTY_SOLD) from sales group by quarter;
(1 mark for each correct SQL)
OR
(i) select bname, auname, price from books where bid like “comp%”;
(ii) update books set price = price + 50 where bid like “hist%”;
(iii) select * from books order by price;
(iv) select bid, bname, qty_issued from books, issued where books.bid =
issued.bid;
(1 mark for each correct SQL)
33.
import csv
file = open('class.csv', 'w' ,newline="")
w1 = csv.writer(file)
with open('marks.csv') as csvfile:
data = csv. reader(csvfile)
for row in data:
if row[1]== '2' :
writer.writerow(row)
file.close()
34.
i. Select * from TRANSACT where TYPE=’Withdraw’;
4|Page
5
ii. Select ANO, AMOUNT from TRANSACT where DOT like ‘%-05-%’;
iii. Select MIN(DOT) from TRANSACT where ANO=102;
iv. A) Select ANO,T.ANO,ANAME,AMOUNT from ACCOUNT A, TRANSACT T
where A.ANO = T.ANO and AMOUNT<=3000;
B) Select ANO, ANAME From ACCOUNT
Where ADDRESS NOT IN ('Chennai', 'Bangalore');
35.
import mysql.connector
records = cursor.fetchall()
for record in records:
print(record)
db_con.close()
Section-E ( 2 x 5 = 10 Marks)
36.
(b) pickle.dump(Stu1,fh)
(d) Rstu=pickle.load(fin)
37.
5|Page