CS - Self Assessment Paper-5-Solution
CS - Self Assessment Paper-5-Solution
statement will return the minimum value of 21. (a) Greater than 10. 2
percentage from column PER in STUDENT table. 1 (b) 10
17. Option (D) is correct.
Explanation: Using append(), only one element at Commonly Made Error
a time can be added. For adding more than one
element, extend() method can be used, this can Sometimes students forget the correct execution
of if statement.
also be used to add elements of another list to the
existing one.
The extend( ) function accepts a list as an argument
Answering Tip
and puts the elements of the list at the end of the
Students should remember the correct working
sequence .
and execution of all conditional and iterative
Example: statements.
>>> a = [10,20,30,40,50]
22. The hierarchical model was developed by IBM in
>>>a.extend([60,70,80])
1968. The data is organised in a tree structure where
>>>a the nodes represent the records and the branches
[10,20,30,40,50,60,70,80] 1 of the tree represent the fields. Since the data is
18. Option (B) is correct. organized in a tree structure, the parent node has
the links to its child nodes.
Explanation: A list can have elements of different
If we want to search a record, we have to traverse
data types, such as integer, float, string, tuple or
the tree from the root through all its parent nodes
even another list. A list is very useful to group
to reach the specific record. Thus, searching for a
together elements of mixed data types.
record is very time consuming 2
Elements of a list are enclosed in square brackets
23. (a) Refresh (F5 key) (1 mark for correct answer)
and are separated by comma. Like string indices,
(b) Web hosting is the service that makes our website
list indices also start from 0. 1
available to be viewed by others on the Internet.
A web host provides space on its server, so that
Section – B other computers around the world can access our
website by means of a network or modem.
19. for i in range(10): (1 marks for correct answer)
_b=20–i 24. True 2
print(b) 2 OR
20. The world wide web (WWW) is a network of online 10.0 # 10.0
content that is formatted in HTML and accessed via 10.0 $ 20
HTTP. The term www refers to all the interlinked 2.0 # 2.0
HTML pages that can be accessed over the Internet. 1.0 # 1.0
The world wide web is an example of client and 1.0 $ 2.0
server technology. The Internet uses software
known as the web browser that requests documents 25. A Candidate Key can be any column or a
combination of columns that can qualify as
located on the web. The request is made by the
unique key in database. There can be multiple
browser to the internet host server containing the
Candidate Keys in one table where as A Primary
document. The browser acts like a host server the
Key is a column or a combination of columns
information and thus, is called the server. 2
that uniquely identify a record.
OR
Only one Candidate Key can be Primary Key.
A computer network is a set of computers sharing
(2 marks for correct difference)
resources located on or provided by network nodes.
OR
The computers use common communication
protocols over digital interconnections to Degree: It is the total number of attributes in the
table.
communicate with each other.
XML – exensible Cardinality: It is the total number of tuples in
the table (2 marks for correct difference)
Markup
[CBSE Marking Scheme, 2019-20]
Language
Solutions 3
26.
(a) CREATE DATABASE MYEARTH; 29. def prime(n):
CREATE TABLE CITY for i in range (2,n/2):
if 0 n%i==0:
(
print(n,"is not prime")
CITYCODE CHAR (5) PRIMARY KEY,
return 3
CITYNAME CHAR (30),
SIZE INT,
30.
status=[]
def Push_element(cust):
AVGTEMP ITN,
if cust[2]=="Goa":
POPULATIONATE INT,
L1=[cust[0],cust[1]]
POPULATION INT;
status.append(L1)
(1 mark correctly creating the table)
def Pop_element ():
(b) (i) 29
num=len(status)
(ii) 01-Jan-2021
while len(status)!=0:
(iii) T006 Console Table 17-Nov-2019 1500 12
(iv) 10-Mar-2020 dele=status.pop()
17-Nov-2019 print(dele)
(½ mark for each correct output) num=num-1
[CBSE Marking Scheme, 2021-22] else:
print("Stack Empty")
27. def CountFirstDigit(): (1.5 marks for correct push_element() and 1.5 marks for
count=0 correct pop_element())
with open(‘Story.txt’,‘r’) as f: OR
while True: def COUNTLINES():
line=f.readline() file=open('Hello.TXT','r')
if not line:
lines = file.readlines()
break
count=0
if line[0].isdigit():
count = count+1 for w in lines:
if count==0: if w[0]=="AN" or w[0]=="an":
print (“no line starts count=count+1
with a digit”) print("Total lines starting with
else: 'AN'", count)
print (“count=”,count) file.close()
(3 marks for correct answer) (1 mark for each correct 1st & 2nd function definition)
OR (1 marks for correct 3rd function definition)
def reverse():
file=open("Poem.txt","r")
text=file.readlines()
Section – D
file.close()
line=len(text) 31.
(i) Block C , It has maximum number of
for i in range (line-1,-1,-1): computers.
print(text[i]) (1 mark for correct answer )
28. (a) DEGREE =5 [CBSE Marking Scheme, 2020]
CARDINALITY=6 (ii) LAN. Because network spans over a
(b) (i) ANO ANAME building. (1 mark for correct answer )
103 Ali Reza [CBSE Marking Scheme, 2020]
105 Simran Kaur (iii) Star topology
(ii) DISTINCT ANO
101
102 Block A
103 Block D
Block C
Note: Values may be written in any order
(iii) ANO Count(*) MIN (AMOUNT)
101 2 2500 Block B
103 2 1000
(1 mark for correct answer )
4 OSWAAL CBSE Sample Question Papers, COMPUTER SCIENCE, Class-XII
Section – E OR
(iii) (a) SELECT DISTINCT DESIGNATION FROM
ADMIN; (1 mark)
34. (i) (i)CODE is primary key (b) SELECT TEACHERNAME, CODE, DESIGNATION
[1 mark for correct answer] FROM SCHOOL, ADMIN WHERE SCHOOL.
(ii) TEACHERNAME is alternative key CODE = ADMIN.CODE AND GENDER = MALE;
(1 mark for correct answer) (1 mark for each correct output)
(iii) (a) SELECT TEACHERNAME, PERIODS FROM
SCHOOL WHERE PERIODS >25;
35. (i) csv
(b) SELECT * FROM SCHOOL ORDER BY (ii) “Student.csv”, "w"
EXPERIENCE DESC; (2 marks) (iii) writer(fh). (1×4=4)
qqq