PB 2
PB 2
(Under the aegis of The Delhi Public School Society, East of Kailash, New Delhi)
Time: 3 Hrs
MM: 70
General Instructions:
● This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions.
●The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
● Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
● Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
● Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written.
1. Identify the correct SQL command to fetch all student names who scored above 80 marks:
(a) SELECT * FROM students WHERE marks > 80;
(b) SELECT name FROM students WHERE marks > 80;
(c) SELECT name FROM students WHERE marks >= 80;
(d) None of the above
2. Which of the following is used to retrieve records in descending order in SQL?
(a) ORDER BY DESC
(b) SORT DESCENDING
(c) GROUP BY DESC
(d) ARRANGE BY DESC
3. Expand CDMA.
4. ____________ is a protocol used for secure communication over a computer network.
5. Which SQL command is used to delete a column from a table?
(a) DROP COLUMN
(b) DELETE COLUMN
(c) ALTER TABLE
(d) REMOVE COLUMN
6. What will be the output of the following Python code?
lst = ["hello", 20, [5, 6]]
print(lst[1:])
7. Which of the following operators is used to perform integer division in Python?
(a) /
(b) //
(c) %
(d) div
8. ____________ is used to display the structure of a database.
9. A database table has 12 rows and 4 columns. What are its degree and cardinality?
(a) 4, 12
(b) 12, 4
(c) 5, 12
(d) 4, 5
10. What is the output of the following Python code?
t = (7, 8, (9,7))
print(len(t))
11. Write one difference between extend and append functions of a list.
12. Which data structure is implemented using LIFO (Last In First Out) principle?
(a) Queue
(b) Stack
(c) Array
(d) List
13. Which file mode allows both reading and writing, but raises an error if the file does not exist?
(a) w
(b) r+
(c) a+
(d) ab
14. Write the syntax for the tell() function in Python.
15. __________ arguments in Python functions must be passed in the exact order in which they
are defined in the function signature.
16. State whether the following statement is True or False: The except block in Python is
executed only if no exception occurs in the try block.
17. What will be the output of the following code?
tuple1 = (1, 2, 3)
tuple2 = tuple1
tuple1 += (4,)
print(tuple1 == tuple2)
18. What does the list.remove(x) method do in Python?
(A) Removes the element at index x from the list
(B) Removes the first occurrence of value x from the list
(C)Removes all occurrences of value x from the list
(D)Removes the last occurrence of value x from the list.
19. If a table which has one Primary key and two alternate keys. How many
Candidate keys will this table have?
(A) 1
(B) 2
(C) 3
(D) 4
20–21. Assertion-Reasoning Questions: Mark the correct choice.
(a) Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
(b) Both Assertion (A) and Reason (R) are true, but R is not the correct explanation of A.
(c) Assertion (A) is true, but Reason (R) is false.
(d) Assertion (A) is false, but Reason (R) is true.
20. Assertion (A): A foreign key in SQL ensures referential integrity between tables.
Reason (R): A foreign key uniquely identifies each record in a table.
21. Assertion (A): Python lists are mutable, while tuples are immutable.
Reason (R): Mutability means that the values of the object in can be changed after it is
created.
SECTION B (Each question carries 2 marks)
22. What are the differences between a shallow copy and a deep copy in Python? Provide
examples.
23. Predict the output of the following code snippet:
y=8
def multiply():
global y
y=y*2
print(y)
multiply()
y = 16
print(y)
OR
What is LEGB? Differentiate between global and local scope.
24. Differentiate between PRIMARY KEY and UNIQUE constraints in SQL.
25. A table named EMPLOYEE has the following structure:
Name VARCHAR(50)
Salary FLOAT
28. Which communication channel is/are suitable in each of the following situations?
(i) Transfer of data from one mobile to another.
(ii) Communication in a hilly area.
OR
a. Write the difference between Bridge and gateway.
b. Expand POP. Give one use of POP in the context of networking.
SECTION C (Each question carries 3 marks)
29. Write a function in Python to read a text file, data.txt, and replaces all the occurrences of ‘s’
with ‘$’
OR
Write a function in Python to create a file upper.txt that has the content of poem.txt in
uppercase.
30. Consider the following SQL table STUDENT:
Table: SALES
OR
Write the definition of a user-defined function `push_even(N)` which accepts a list of integers
in a parameter `N` and pushes all those integers which are even from the list `N` into a Stack
named `EvenNumbers`. Write function pop_even() to pop the topmost number from the
stack and returns it. If the stack is already empty, the function should display "Empty".
For example:
If the integers input into the list `VALUES` are:
[10, 5, 8, 3, 12]
Then the stack `EvenNumbers` should store:
[10, 8, 12]
33. Write the following SQL queries based on the EMPLOYEE table below:
Table: COURSES
FROM-TO DISTANCE
ADMIN 110
DECORATORS 75
MEDIA 12
FOOD 20
i) Suggest the most appropriate location of the server inside the MUMBAI campus (out of the
4 buildings).Justify your answer.
ii) Draw the cable layout to efficiently connect various buildings within the MUMBAI campus.
iii) Which hardware device will you suggest to connect all the computers within each
building?
iv) Which of the following will you suggest to establish online face-to-face communication
between the people in the Admin Office of the MUMBAI campus and the DELHI Head Office?
a. Cable TV
b. Email
c. Video Conferencing
d. Text Chat
v) What type of network (out of PAN, LAN, MAN, WAN) will be set up in each of the
following cases?
a. The Mumbai campus gets connected with the Head Quarter in Delhi
b. The computers connected in the MUMBAI campus
---END---