CS-SQP-Set 2-Ranchi
CS-SQP-Set 2-Ranchi
CS-SQP-Set 2-Ranchi
RANCHI REGION
SAMPLE QUESTION PAPER (2022-23)
CLASS: XII MAX TIME: 3:00 Hrs.
General Instructions:
i) This question paper contains five sections, Section A to E.
ii) All questions are compulsory.
iii) Section A have 18 questions carrying 01 mark each.
iv) Section B has 07 Very Short Answer type questions carrying 02 marks each.
v) Section C has 05 Short Answer type questions carrying 03 marks each.
vi) Section D has 03 Long Answer type questions carrying 05 marks each.
vii) Section E has 02 questions carrying 04 marks each. Question no 35 has internal choice in
part c.
viii) All programming questions are to be answered using Python Language only.
SECTION A
1. Name the Python modules which need to be imported to invoke the following functions. [1]
a) dump() b) connect()
A = “Hello”
print(list(A))
4. Write the statements to print the first and the last appointment from the following tuple declaration.
[1]
a = (1,2,3,4)
del(a[2])
print(a)
8. Write SQL statement to round off value 15.193 to nearest ten’s. [1]
st = “Computer Science”
st.sialnum()
SELECT MONTH(‘2020-05-11’);
a) 5 b) 11 c) May d) November
12. Which type of error will be returned by the following code? [1]
13. If the following code is executed, what will be the output? [1]
a) P b) MONOP c) A d) ERROR
14. ___________ is the key that has not been selected to be the primary key from the candidate keys.
[1]
Page 2 of 9
15. A combination of bus and star topologies is called a __________ topology. [1]
16. In SQL, which command can be used to see structure of a tables SCHOOL? [1]
Question number 17 and 18 are ASSERTION AND REASONING based questions and carry 1
Marks each. Mark the correct choice as
(a) Both A and R are true and R is the correct explanation for A
(b) Both A and R are true and R is not the correct explanation for A
17. Assertion(A): The positional parameters receive the values irrespective of the corresponding order of
the arguments in the function header.
Reason(R): It means if three arguments are to be passed to the function, the first argument will be
assigned to the first parameter, second argument to the second parameter and the third argument to the
third parameter.
18. Assertion(A): The CSV file is a simple text file format that is used to store data in tabular form.
Reason(R): The binary file stores data in machine readable form. This file is more reliable and secure
when data transfer takes place from one device to other. This is the reason why most of the fields are
written in binary mode.
SECTION B
a) 25 * 3 + 25 % 4 – 50 ** 2 // 2
20. Differentiate between GPRS and GSM in context with mobile communications. [2]
Or
Differentiate between Internet Mail Access Protocol and Simple Mail Transfer Protocol. [2]
21. Rewrite the following code in Python after removing all syntax error(s). Underline each correction
done in the code. [2]
Page 3 of 9
M = [43,44,45)
X = 0
while X < M:
if X % 2 <> 0:
print(M*4)
elseif X % 5 = 0:
print(X**3)
print(X*10)
X + = 1
22. Write the output of the following SQL command. [2]
23. Write two SQL statement for MID and SUBSTR using string “India is great”. [2]
25. What do you mean by function in Python? Explain with its types in Python? [2]
Or
Differentiate between break and return statement in Python. Give an example of each. [2]
SECTION C
26. Consider a list of employees containing empNo, empName and empSalary. Write a function in
Python PUSH(Stack, List), to push only those records from a list whose salary is more than 50000/-.
At every insertion return the current location of TOP. [3]
27. Write a function Count() in Python, which should read text file “ALPHA.TXT” to count and return
the total number of consonants present in it. [3]
28. Assuming that NUM is a list of variables, write a function manipulate(NUM) in Python to divide all
the elements of list by 10 which are divisible by 5 and multiply the other list elements by 2. Elements
of the list can be changed to float as a result of division by 10. [3]
29. a) Write SQL command to view all the databased of MYSQL. [1]
b) Write the outputs of the SQL queries (i) to (ii) based on the relations Employees and Package given
below: [2]
Page 4 of 9
Table: Employees
Emp_No FirstName LastName Designation City
M001 Monika Verma Manager Delhi
D001 Ritu Singh Director Noida
C001 Neha Sharma Clerk Noida
C002 Shelly Sharma Clerk Faridabad
M002 Kavita Kapoor Manager Jaipur
Table: Package
Emp_No Basic HRA TA
D001 1200000 9500 8000
M001 1000000 9400 9000
M002 1050000 13450 9000
30. Write the outputs of the SQL queries (a) to (d) based on the relations Employees and Package given
below:
Table: OldStock
SNO Name Type Qty Price Discount
1 Little Ones Baby Cot 5 5000 10
2 Wooden Study Table 7 4000 10
3 Royal Sofa 4 20000 15
4 Wooden Chairs 4 12000 15
5 Royal Couch 2 22000 20
Table: FreshStock
SNo Name Type Price
1 Little Ones Chairs 30000
2 Blue Lotus Sofa 25000
3 Royal Couch 10000
Page 5 of 9
SELECT OS.NAME, OS.TYPE, FS.NAME, FS.TYPE FROM OLDSTOCK OS,
FRESHSTOCK FS WHERE OS.SNO = FS.SNO;
b) Write the output of the queries (i) to (iv) based on the tables given above. [2]
i) SELECT NAME, TYPE FROM FRESHSTOCK ORDER BY TYPE;
ii) SELECT AVG(PRICE) FROM OLDSTOCK WHERE NAME = “WOODEN”;
iii) SELECT DISTINCT NAME FROM OLDSTOCK;
iv) SELECT MIN(QTY) FROM OLDSTOCK GROUP BY TYPE HAVING PRICE
> 4000;
SECTION D
31. What is the difference between text and CSV file? Write a program in python with following two
functions and make call of them within the program: [5]
i) ADD() – To accept grocery code, name, price and quantity and store the data permanently in the
“groceries.csv” file.
import random
def week_days():
days = [“Mon”, “Tue”, “Wed”, “Thu”, “Fri”]
v = random.randrange(len(days) – 1)
for I in range(v, 0, -1):
print(days[i], “-“, i+1)
week_days()
OR
def convert(x):
x = list(x)
n = len(x)
for i in range(0, n, 2):
w = x[i]
x[i] = x[i+1]
x[i+1] = w
Page 6 of 9
for i in range(1, n):
if x[i] ==’’:
x[i] = ‘-‘
elif x[i] > ‘a’ and x[i] < ‘z’:
x[i] = chr(ord(x[i]) – 32)
return x
x = ‘Board Exam’
print(convert(x))
b) Study the following code and answer the question given from i) to iii) [3]
import mysql.connector as sql
i) Write Python statement to create at cursor at the blank space marked as statement 1
ii) Write Python statement to read all the data from database to system memory at the blank
space marked as statement 2
iii) Write Python statement to close the database connection at the blank space marked as
statement 3
33. Hi Speed Technologies Ltd. Is a Delhi based organization which is expanding its office setup to
Chandigarh. At Chandigarh office campus, they are planning to have 3 different blocks for HR,
Accounts and Logistics related work. Each block has number of computers, which are required to
connected in a network for communication, data and resource sharing.
Chandigarh Office
Delhi
HR Block Account Block
Head Office
Logistics Block
Page 7 of 9
As a network consultant, you have to suggest the best network related solutions for them for
issues/problems raised in (i) to (v), keeping in mind the distances between various blocks/location and
other given parameters. [5]
HR Block 70
Accounts Block 50
Logistics Block 40
a) Suggest the most appropriate block/location to house the server in the Chandigarh Office (out of
the 3 blocks) to get the best and effective connectivity. Justify your answer.
b) suggest the best wired medium and draw the cable layout (Block to Block) to effectively connect
various blocks with the Chandigarh office compound.
c) Suggest a device/software and its placement that would provide data security for the entire network
of Chandigarh office.
SECTION E
34. Reema wants write a program in Python to copy the contents of list1 to list2 based on certain
condition. Help her to complete the code as instructed in question (i) to (iii)
import pickle
list1, list2 = [2, 3, 4, 5, 6, 7, 8, 9, 10], []
for i in list1:
Page 8 of 9
if
(i%2==0 and i%4==0):
list2.__________ #Statement 1
f = open("bin.dat","wb")
____________________ #Statement 2
f.close()
f = open("bin.dat", "rb")
data = ______________ #Statement 3
f.close()
for i in data:
print(i)
a) She wants to add I into the list2. Write the complete statement 1 to perform the task. [1]
b) She wants to write the content of the list2 into the disk file. Compete statement 2 for that.
[1]
c) Complete statement 3 so that she can perform rest of the task as written in code. [2]
a) Write SQL statement to display details of all the products not manufactured by HL. [1]
b) Write SQL statement to display name of the detergent powder manufactured by HL. [1]
c) Write SQL statement to display the name of the Product whose price is more than 0.5 hundred.
[2]
OR
c) Write SQL statement to display name of all such Product which start with letter ‘N’ [2]
----------------------------------------------------------*****-------------------------------------------------------
Page 9 of 9