0% found this document useful (0 votes)
38 views7 pages

SQP 21 - QP

The document is a question paper for the Pre Board Examination 2020-21 for Class XII in Computer Science, consisting of two parts: Part A with short answer and case study questions, and Part B with descriptive questions. It covers various topics including Python programming, SQL commands, and data structures. The paper allows for internal options and requires answers to be provided in Python language.

Uploaded by

yaaraanthapaiya
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)
38 views7 pages

SQP 21 - QP

The document is a question paper for the Pre Board Examination 2020-21 for Class XII in Computer Science, consisting of two parts: Part A with short answer and case study questions, and Part B with descriptive questions. It covers various topics including Python programming, SQL commands, and data structures. The paper allows for internal options and requires answers to be provided in Python language.

Uploaded by

yaaraanthapaiya
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/ 7

Subject Code: 20-21/CS/C

Kendriya Vidyalaya Sangathan, Jaipur Region


Pre Board Examination 2020-21
Class: XII Session: 2020-21
Computer Science (083)
Maximum Marks: 70 Time Allowed: 3 hours
General Instructions:
1. This question paper contains two parts A and B. Each part is compulsory.
2. Both Part A and Part B have choices.
3. Part-A has 2 sections:
a. Section – I is short answer questions, to be answered in one word or one line.
b. Section – II has two case studies questions. Each case study has 4 case-based
subparts. An examinee is to attempt any 4 out of the 5 subparts.
4. Part - B is Descriptive Paper.
5. Part- B has three sections
a. Section-I is short answer questions of 2 marks each in which two question have
internal options.
b. Section-II is long answer questions of 3 marks each in which two questions have
internal options.
c. Section-III is very long answer questions of 5 marks each in which one question has
internal option.
6. All programming questions are to be answered using Python Language only

Q.No Part-A Marks


Section-I
Attempt any 15 questions from question no 1 to 21.
1 Can List be used as keys of a dictionary? 1
2 Which one is valid relational operator in Python 1
i. /
ii. =
iii. ==
iv. and
3 Which of the following can be used as valid variable identifiers in Python? 1
i) 4th Sum
ii) Total
iii) Number#
iv) _Data
4 Identify the mutable data types? 1
(i) List
(ii) Tuple
(iii) Dictionary
(iv) String
5 What is the length of the tuple shown below? 1
t=(((('a',1),'b','c'),'d',2),'e',3)
6 A non-key attribute, whose values are derived from primary key of some 1
other table.
i. Alternate Key
ii. Foreign Key
iii. Primary Key
iv. Candidate Key
7 What is Telnet? 1
8 State whether the following statements is True or False. 1
When two entities are communicating and do not want a third party to listen,
this situation is defined as secure communication.
9 Expand the term 1
i. XML
ii. SMS
10 Name two web scripting languages. 1
11 What is the output of the below program? 1

def say(message, times = 1):


print(message * times)
say('Hello')
say('World', 5)
12 Name the python library need to be imported to invoke following function 1
i. sqrt()
ii. randint()
13 Write a Python Dictionary named classstudent with keys 12101,12102,12103 1
and corresponding values as ‘Rahul’,’Ravi’,’Mahesh’ respectively
14 Identify the DDL Command. 1
(i) Insert into command
(ii) Create table command
(iii) Drop table Command
(iv) Delete command
15 t1=(2,3,4,5,6) 1
print(t1.index(4))
output is
i. 4
ii. 5
iii. 6
iv. 2
16 Which clause is used with a SELECT command in SQL to display the records in 1
ascending order of an attribute?
17 Which of these is not an example of unguided media? 1
(i) Optical Fibre Cable (ii) Radio wave (iii) Bluetooth (iv) Satellite
18 A relation has 45 tuples & 5 attributes, what will be the Degree & Cardinality 1
of that relation?
i. Degree 5, Cardinality 45
ii. Degree 45, Cardinality 5
iii. Degree 50, Cardinality 45
iv. Degree 50, Cardinality 2250
19 In SQL, which aggregate function is used to count all records of a table? 1
20 Given 1
employee={'salary':10000,'age':22,'name':'Mahesh'}
employee.pop('age')
what is output
print(employee)
21 What is HTML? 1
Section-II
Both the case study based questions are compulsory. Attempt any 4
subparts from each question. Each question carries 1 mark.
22 Parth Patel of class 12 is writing a program to create a CSV file “emp.csv” 4
which will contain employee code and name of some employees. He has
written the following code. As a programmer, help him to successfully
execute the given task.
import #Line 1
def addemp(empcode,name):#to write/add data into the CSV file
fo=open('emp.csv','a')
writer=csv. (fo) #Line 2
writer.writerow([empcode,name])
fo.close()

#csv file reading code


def reademp():
with open('emp.csv',' ') as fin: #Line 3
filereader=csv.reader(fin)
for row in filereader:
for data in row:
print(data,end='\t')
print(end='\n')
fin. #Line 4

addemp('E105','Parth')
addemp("E101",'Arunima')
addemp("E102",'Prahalad')
reademp() #Line 5
Answer the following questions: (1 mark each)
(a) Name the module he should import in Line 1.
(b) Fill in the blank in Line 2 to write the data in a CSV file.
(c) In which mode, Parth should open the file to read the data from the
file(Line 3).
(d) Fill in the blank in Line 4 to close the file.
(e) Write the output he will obtain while executing Line 5.

23 ABC school is considering to maintain their student’s information using SQL 4


to store the data. As a database administrator Harendra has decided that:
Name of database : school
Name of table : student
Attributes of the table are as follow:
AdmissionNo-numeric
FristName –character of size 30
LastName - character of size 20
DOB - date
Table student
AdmissionNo FirstName LastName DOB
012355 Rahul Singh 2005-05-16
012358 Mukesh Kumar 2004-09-15
012360 Pawan Verma 2004-03-03
012366 Mahesh Kumar 2003-06-08
012367 Raman Patel 2007-03-19
Attempt any four questions
(i) What is the degree and cardinality of the table student 1
(ii) Identify the attribute best suitable to be declared as Primary Key 1
(iii) Insert the following data in table student 1
AdmissionNo=012368
FirstName = Kamlesh
LastName = Sharma
DOB =01 Jan 2004
(iv) Harendra wants to remove the data of mukesh whose admission 1
no is 012358, suggest him SQL command to remove the above
said data.
(v) To remove the table student which command is used : 1
i. Delete from student
ii. Drop table student
iii. Drop database school
iv. Delete student from school
Part-B
Section-I
24 Differentiate between “w” and “r’ modes used in Python. Illustrate with 2
suitable example.
25 Differentiate between fatchone() and fatchmany() method with suitable 2
example.
26 What is significance of Primary Key? Give a suitable example of Primary key 2
from a table containing some meaningful data.
27 Predict the output for following code. 2
def replaceV(st):
newstr = ''
for character in st:
if character in 'aeiouAEIOU':
newstr += '*'
else:
newstr += character
return newstr
st = “Hello how are you”
st1 = replaceV(st)
print("The original String is:", st)
print("The modified String is:", st1)
28 Rewrite the following code after removing syntax error and underline the 2
correction:
x=int(“Enter value for x:”)
for y in range[0,11]:
if x=y
print(x+y)
else:
Print x-y
29 What is protocol? Name some commonly used protocols. 2
OR
Differentiate between virus and worms in context of networking and data
communication threats.
30 What is difference between actual parameter and formal parameter? Explain 2
with suitable example.
31 What possible output(s) are expected to be displayed on screen at the time 2
of execution of the program from the following code?
Import random
Ar=[20,30,40,50,60,70]
From =random.randint(1,3)
To=random.randint(2,4)
for k in range(From,To+1):
print(ar[k],end=”#”)
(i) 10#40#70# (iii) 50#60#70#
(ii) 30#40#50# (iv) 40#50#70#

32 Differentiate between DELETE and DROP TABLE command. 2


33 Write a program that reads a string and check whether it is a palindrome 2
string or not.
Section II
34 Table : Employee 3
EmployeeId Name Sales JobId
E1 Sumit Sinha 110000 102
E2 Vijay Singh 130000 101
Tomar
E3 Ajay Rajpal 140000 103
E4 Mohit Kumar 125000 102
E5 Sailja Singh 145000 103
Table: Job
JobId JobTitle Salary
101 President 200000
102 Vice President 125000
103 Administrator Assistant 80000
104 Accounting Manager 70000
105 Accountant 65000
106 Sales Manager 80000
Give the output of following SQL statement:
(i) Select max(salary),min(salary) from job
(ii) Select Name,JobTitle, Sales from Employee,Job
where Employee.JobId=Job.JobId and JobId in (101,102)
(iii) Select JobId, count(*) from Employee group by JobId
35 Write a function in python that displays the number of lines starting with ‘H’ 3
in the file
“para.txt”. Example, if file contains:
Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow
Then the lines count should be 2
OR
Write a function countmy() in Python to read file Data.txt and count the
number of times “my” occur in file. For example, if the file contain
This is my website. I have displayed my preferences in the choice section
The countmy() function should display the output as :” my occurs 2 times”
36 Write a user define function in Python for push(list) and pop(list) for 3
performing push and pop operations with a stack of list containing integers.
37 Write a function LShift(arr,n) in python, which accepts a list of numbers and n 3
as numeric value by which all elements of the list are shifted to left.
Sample Input data of the list
Arr=[10,20,30,40,12,11]. n=2
Output
Arr[30,40,50,12,11,10,20]
Section-III
38 Write SQL Commands for the following queries based on the relations 5
PRODUCT and CLIENT given below.
Table: Product
P_ID ProductName Manufacturer Price ExpiryDate
TP01 Talcum LAK 40 2011-06-26
Powder
FW05 Face Wash ABC 45 2010-12-01
BS01 Bath Soap ABC 55 2010-09-10
SH06 Shampoo XYZ 120 2012-04-09
FW12 Face Wash XYZ 95 2010-08-15

Table: Client
C_ID ClientName City P_ID
1 Cosmetic Shop Delhi FW05
6 Total Health Mumbai BS01
12 Live Life Delhi SH06
15 Pretty One Delhi FW05
16 Dreams Bengaluru TP01
14 Expressions Delhi NULL

(i) To display the ClientName and City of all Mumbai- and Delhi-based
clients in Client table.
(ii) Increase the price of all the products in Product table by 10%.
(iii) To display the ProductName, Manufacturer, ExpiryDate of all the
products that expired on or before ‘2010-12-31’.
(iv) To display C_ID, ClientName, City of all the clients (including the ones
that have not purchased a product) and their corresponding
ProductName sold.
(v) To display productName, Manufacturer and ClientName of Mumbai
City.
39 Quick Learn University is setting up its academic blocks at Prayag Nagar and 5
planning to set up a network. The university has 3 academic blocks and one
human resource Centre as shown in the diagram given below:

Business Technology Block

HR Centre
Law Block

Centre-to-Centre distance between various blocks is as follows:


Law block to business block 40 m
Law block to technology block 80 m
Law block to HR block 105 m
Business block to technology block 30 m
Business block to HR block 35 m
Technology block to HR block 15 m

Number of computers in each of the buildings is as follows:


Law block 15
Technology block 40
HR Centre 115
Business block 25
(a) Suggest a cable layout of connection between the blocks.
(b) Suggest the most suitable place to house the server of the organization
with suitable reason.
(c) Which device should be placed/installed in each of these blocks to
efficiently connect all the computers within these blocks?
(d) The university is planning to link its sales counters situated in various
parts of the other cities. Which type of network out of LAN, MAN or WAN will
be formed?
(e) Which network topology may be preferred in each of these blocks?
40 (a) Create a binary file “employee.dat” that stores the records of employees 5
and display them one by one.
(b) Display the records of all those employees who are getting salaries
between 25000 to 30000.
OR
A binary file student.dat has structure (rollno,name,class,percentage). Write
a program to updating a record in the file requires roll number to be fetched
from the user whose name is to be updated

You might also like