Class 12 Computer Science Sample Paper Set 7
Class 12 Computer Science Sample Paper Set 7
Join School of Educators' exclusive WhatsApp, Telegram, and Signal groups for FREE access
to a vast range of educational resources designed to help you achieve 100/100 in exams!
Separate groups for teachers and students are available, packed with valuable content to
boost your performance.
Additionally, benefit from expert tips, practical advice, and study hacks designed to enhance
performance in both CBSE exams and competitive entrance tests.
Don’t miss out—join today and take the first step toward academic excellence!
COMPUTER SCIENCE
All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one
of the choices in such questions.
Section A
1. If the addition of a new key:value pair causes the size of the dictionary to grow beyond its original size, an error [1]
occurs.
2. Which of the following is not an aggregate function? [1]
a) Min b) With
c) Avg d) Sum
3. Which of the following is not a legal method for fetching records from database from within Python? [1]
a) fetchtwo( ) b) fetchall( )
c) fetchone( ) d) fetchmany( )
4. Select the correct output of the code: [1]
a) nfi.read( ) b) infi.readlines( )
c) infi.read(all) d) infi.readline( )
8. Which of the following is not a character data type in SQL? [1]
a) VARCHAR1 b) VARCHAR
c) CHAR d) VARCHAR2
9. Consider the table with structure as: [1]
Student(ID, name, dept name, tot_cred)
Which attribute will form the primary key?
a) Dept b) ID
a) Final b) Top
c) Last d) First
13. In SQL, write the name of the aggregate function which will display the cardinality of a table. [1]
14. A ________ is a network spread across states, countries or whole world. [1]
a) PAN b) LAN
c) WAN d) MAN
15. Which of the following functions will return the string in all caps? [1]
a) toupper() b) to-upper()
c) isupper() d) upper()
16. Which of the following group functions ignore NULL values? [1]
c) SUM d) COUNT
17. Computer communication signal which is in the form of the continuous wave is called [1]
a) modulation signal b) Binary signal
a) Both A and R are true and R is the correct b) Both A and R are true but R is not the
explanation of A. correct explanation of A.
a) Both A and R are true and R is the correct b) Both A and R are true but R is not the
explanation of A. correct explanation of A.
a) Both A and R are true and R is the correct b) Both A and R are true but R is not the
explanation of A. correct explanation of A.
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12 14 16 18
3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
8 16 24 32 40 48 56 64 72
9 18 27 36 45 54 63 72 81
OR
What is the output of below questions?
l1 = [23, 45, 19, 77, 10, 22]
i. l1. sort ( )
ii. max(l1)
25. What are data types? What are the main objectives of datatypes? [2]
26. Find the error in following code. State the reason of the error. [2]
aLst = {'a' : 1, 'b' : 2, 'c' : 3}
print (aLst['a', 'b'])
OR
Observe the following tuple and answer the questions that follow:
i. t1 [2 : 4]
ii. t1 [- 6]
27. What are csv files? [2]
OR
Your recipe uses some ingredients. Write a program to store the list of ingredients in a binary file.
28. Differentiate between fruitful functions and non-fruitful functions. [2]
Section C
29. Write functions in Python for PushS(List) and for PopS(List) for performing Push and Pop operations with a [3]
stack of List containing integers. The function must check for Empty Stack.
OR
Write a function that takes a list that is sorted in ascending order and a number as argument. The function should do
the following:
i. Insert the number passed as argument in a sorted list.
ii. Delete the number from the list.
30. Consider the following table with their fields [3]
EMPLOYEE ( E_CODE, E_NAME, DESIG, SALARY, DOJ)
List the names, salary, PF, HRA, DA of all the employees in the EMPLOYEE table. HRA is 25% of salary and
DA is 10% of salary. PF is 5% of salary. The result should be in descending order of salary.
OR
Write the output of SQL queries (a) to (d) based on the table VACCINATION_DATA given below:
TABLE: VACCINATION_DATA
VID Name Age Dose1 Dose2 City
Table: CUSTOMER
Table: FABRIC
FCODE TYPE
F04 POLYSTER
F02 COTTON
F03 SILK
F01 TERELENE
Table: SUPPLIERS
i. To display the details of all the products in ascending order of product names (i.e., PNAME).
ii. To display product name and price of all those products, whose price is in the range of 10000 and 15000
(both values inclusive).
iii. To display the number of products, which are supplied by each supplier, i.e., the expected output should be;
S01 2
S02 2
S03 1
iv. To display the price, product name, and quantity (i.e., qty) of those products which have a quantity of more
than 100.
v. To display the names of those suppliers, who are either from DELHI or from CHENNAI.
vi. To display the name of the companies and the name of the products in descending order of company names.
vii. Obtain the outputs of the following SQL queries based on the data given in tables PRODUCTS and
SUPPLIERS above.
a. SELECT DISTINCT SUPCODE FROM PRODUCTS;
b. SELECT MAX (PRICE), MIN (PRICE) FROM PRODUCTS;
c. SELECT PRICE*QTY FROM PRODUCTS WHERE PID = 104;
d. SELECT PNAME, SNAME FROM PRODUCTS P, SUPPLIERS S WHERE P. SUPCODE = S.
SUPCODE AND QTY >100;
OR
Consider the following tables WORKER and PAYLEVEL and answer the following parts of this question :
Table : WORKER
Table : PAYLEVEL