PP-4 QP
PP-4 QP
PP-4 QP
PRACTICE PAPER-4
Question Paper
Class: XII Subject: Computer Science (083)
Maximum Marks: 70 Period: 3 Hours
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 the case of MCQ, the text of the correct answer should also be written.
Page 1 of 7
8 Consider the given list L: 1
L = list('All is well in ')
What python code should be written for inserting the word 'Havana' at the end of
the list as separate characters?
a. L.extend('Havana') b. L.append(list('Havana'))
c. both a and b d. None of the above
9 What will be the output of following python code: 1
l2= [1,2,3,'[4,5]']
print(type(l2[-1]))
a. error b. <class ‘list’> c. <class ‘string> d. <class ‘NoneType’>
10 Suppose the content of a text file xyz.txt is as follows: 1
"The best way to Predict the future is to create it."
What will be the output of the following python code?
f = open("xyz.txt")
f.seek(17)
s = f.read(7)
print(s)
f.close()
a. Predict b. The best way to
c. predict the d. to predict the future
11 In Python exception handling, the finally block is executed regardless of whether an 1
exception occurs or not. (True/False)
12 def func(a, b, c=3, d=4): 1
pass
Identify the keyword and positional arguments in the function given above:
a) a and b are positional arguments; c and d are keyword arguments
b) a, b, c, and d are all positional arguments
c) a, b, c, and d are all keyword arguments
d) a, b, and c are positional arguments; d is a keyword argument
13 What is the output of following SQL statement? 1
SELECT Department, COUNT(*) FROM employees
WHERE Salary > 50000 GROUP BY Department;
a. The total number of employees in each department
b. The departments with employees earning over 50,000 and the count of such
employees in each department
c. The departments with average salary over 50,000 and their total number of
employees
d. The number of departments with employees earning over 50,000
14 Consider a table named 'Products' with columns 'product_id', 'product_name', and 1
'category'. Which of the following SQL queries will retrieve all products that are not
in the categories 'Electronics' or 'Furniture'?
a. SELECT product_id, product_name FROM Products
WHERE category NOT IN ('Electronics', 'Furniture');
b. SELECT product_id, product_name FROM Products
WHERE category NOT IN 'Electronics', 'Furniture';
c. SELECT product_id, product_name FROM Products
WHERE category != 'Electronics' AND != 'Furniture';
d. SELECT product_id, product_name FROM Products
WHERE category NOT LIKE ('Electronics', 'Furniture');
15 In MySQL, which command does not change the cardinality of a relation? 1
a. ALTER b. INSERT c. DELETE d. None of these
Page 2 of 7
16 Sita is creating a table for her project. She wants that a particular column always 1
has a unique value. Which constraint should she use?
a. DISTINCT b. UNIQUE c. NOT NULL d. DEFAULT
17 Which of the following is a network protocol? 1
a. Firewall b. HTTP c. Modem d. Switch
18 The Router in a network primarily functions as a __________. 1
a. Converter b. Traffic director c. Amplifier d. Modulato
19 Write the full form of the following: (i) FTP (ii) DNS 1
Q20 and Q21 are Assertion(A) and Reason(R) based questions. 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
(C) A is True but R is False
(D) A is False but R is True
20 Assertion: Assertion: In Python, a function can return multiple values. 1
Reason: Python functions can return tuples, which can be unpacked into multiple
variables.
21 Assertion: The FOREIGN KEY constraint is used to establish links between tables. 1
Reason: A FOREIGN KEY in one table points to a FOREIGN KEY in another table.
Page 4 of 7
Observe the table Students and write query for (i) to (iii): 3
31 Table: Faculty
F_ID FName LName Department Gender Hire_Date Salary
102 Ibomcha Thounaojam Exam M 10/02/2020 75000
103 Shantanu Fernandes Exam M 11/01/2015 120000
104 Tashi Dorjey ICT F 14/03/2023 50000
105 Bhanwar Singh ICT M 13/12/2019 80000
106 Kanta Kumari HOD F 11/01/2024 140000
(A)
(i) Display Gender wise number of faculties who earn more than 85000.
(ii) Display all data separated by Department and in decreasing order of Salary.
(iii) Display FName and F_ID of faculties from ICT department.
OR
(B)
(i) Display Gender wise average salary of those faculties with average salary
more than 90000.
(ii) Display FName and F_ID of faculties having the string ‘ta’ in the Fname.
(iii) Change data of table to award 5% annual increment in salary.
Page 5 of 7
34 Give output of the following queries as per given table(s): 4
WORKER
WID WNAME JOB SALARY DNO
1001 RAHUL SHARMA CLERK 15000 D03
1002 MUKESH VYAS ELECTRICIAN 11000 D01
1003 SURESH FITTER 9000 D02
1004 ANKUR GUARD 8000 D01
DEPT
DNO DNAME LOC MANAGER
D01 PRODUCTION GROUND FLOOR D K JAIN
D02 ACCOUNTS 1ST FLOOR S ARORA
D03 SECURITY 1ST FLOOR R K SINGH
(i) SELECT DISTINCT JOB FROM WORKER;
(iii) SELECT DNAME, LOC FROM DEPT WHERE SALARY > 10000;
(iv) SELECT W.WNAME, D.MANAGER FROM WORKER AS W, DEPT AS D
WHERE W.DNO = D.DNO;
(v) SELECT WNAME FROM WORKER WHERE WNAME LIKE 'R%';
35 A table named Products in a database named Inventory stores information about 4
products. The table has the following columns: ProductID (integer, primary key),
ProductName (string), Price (float), and Quantity (integer). Assume the database
username is 'admin' and the password is 'secure123'.
Write a Python code that prompts the user to enter a ProductID and updates the
Quantity of that product by adding 10 to the existing quantity. Handle any potential
errors (e.g., the product ID not existing in the table).
Page 6 of 7
37 Kendriya Vidyalaya No 1 Jaipur is setting up the network between its Different Wings 5
of school campus. There are 4 wings named as – SENIOR(S), JUNIOR(J), ADMIN(A)
and HOSTEL(H).
Distance between various wings are given below:
Wing A to Wing S 80m
Wing A to Wing J 200m
Wing A to Wing H 400m
Wing S to Wing J 70m
Wing S to Wing H 120m
Wing J to Wing H 450m
Page 7 of 7