Mid Term Practice Paper
Mid Term Practice Paper
BANGALORE EAST
MID-TERM 2023– 2024 PRACTICE PAPER
Name: Date:
Subject: Computer Science Class: XII
Duration: 3 hours Max.Marks:70
General Instructions:
1. Please check this question paper contains 35 questions.
2. The paper is divided into 4 Sections- A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 3 questions (31 to 33). Each question carries 5 Marks.
7. Section E, consists of 2 questions (34 to 35). Each question carries 4 Marks.
8. All programming questions are to be answered using Python Language only.
3 Which keyword is used for table aliasing that involves giving a table short and 1
alternative name to simplify query syntax?
a. from
b. as
c. where
d. on
What will be the number of rows and columns for the following statement?
SELECT * FROM Uniform NATURAL JOIN Cost;
5,5 b. 4, 4 c. 4, 5 d. 5, 6
6 In an SQL table, if the primary key is combination of more than one field, then 1
it is called as .
7 If column “salary” of table “EMP” contains the dataset {10000, 15000, 25000, 1
10000,25000}, what will be the output of following SQL statement?
SELECT SUM(DISTINCT SALARY) FROM EMP;
a) 75000 b) 25000 c) 10000 d) 50000
8 D={“AMIT”:90,”RESHMA”:96,”SUMAN”:92} 1
print(“SUMAN” in D, 90 in D, sep=”#”)
(a) True#False (b) True#True (c) False#True (d) False#False
9 Evaluate the following 1
35/5 or 5.0 + 30/10
a. True b. 7.0 c. 8.0 d. 7
10 Choose the most correct statement among the following – 1
(a) a dictionary is a sequential set of elements
(b) a dictionary is a set of key-value pairs
(c) a dictionary is a sequential collection of elements having key-value pairs
(d) a dictionary is a non-sequential collection of elements
13 Suppose str1= ‘welcome’. All the following expression produce the same result 1
except one?
(a) str[ : : -6] (b) str[ : : -1][ : : -6] (c) str[ : :6] (d) str[0] + str[-1]
17 Assertion (A): The function definition calculate(a, b, c=1,d) will give error. 1
Reason (R): All the non-default arguments must precede the default
arguments.
SECTION-B
20 Arjun has written a program using function to find and return the sum of 2
natural numbers up to the given limit i.e. Number. Identify the logical and
syntactical errors in the program segment given below. Rewrite the corrected
code and underline each corrections made.
21 Differentiate between Drop and Delete commands of MYSQL. Write its syntax. 2
26 Consider the table GRADUATE given below and write the output of the SQL 3
queries that follow.
i) SELECT COUNT(DISTINCT SUBJECT) FROM GRADUATE;
ii) SELECT STIPEND*12, NAME FROM GRADUATE WHERE DIV=’I’ AND
AVERAGE >65;
iii) SELECT * FROM GRADUATE WHERE SUBJECT NOT IN(‘PHYSICS’,
‘CHEMISTRY’);
i) Increase the price of the juices by 3% whose name begins with ‘A’.
ii) Delete the record of those juices having calories more than 140.
iii) Insert the following record into the table
DrinkCode – 107, Dname – Santara Special, Price – 25.00, Calorie –
130
30 Write a menu driven python program using a single function that can perform 3
i. sum of squares of 2 numbers passed as arguments
ii. sum of squares of 3 numbers passed as arguments
iii. Exit from the program
For example:
If a=2 and b=3, where a and b are parameters to function. Then the function
should return the value 22+32 i.e. 13.
Similarly, if a=2, b=3 and c=10, where a,b,c are parameters to the same
function. Then the function should return the value 22+32+102 i.e. 113.
SECTION – D
Table : Company
1. Which field(along with table name) will be considered as the foreign key
as per the above tables.
2. Name all the fields from the relation Event which are capable of being a
candidate key
4. What will be the cardinality and degree for the cartesian product of
Event and Company table.
import random
Arr=[10,30,40,50,70,90,100]
L=random.randrange(1,3)
U=random.randrange(3,6)
for i in range(L,U+1):
print(Arr[i],"@",end="")
(i) 40 @50 @
(ii) 10 @50 @70 @90 @
(iii) 40 @50 @70 @90 @
(iv) 40 @100 @
ii) Write a python program to Convert the string S into the Dictionary D.
The format of input string and output dictionary is given below.
S = "Jan=January;Feb=February;Mar=March"
D = {' Jan ': ' January', ' Feb ': ' February', ' Mar ': ' March'}
33 i) Write the output for the following python code: 2+3
def Quo_Mod (L1):
L1.extend([33,52])
for i in range(len(L1)):
if L1[i]%2==0:
L1[i]=L1[i]/5
else:
L1[i]=L1[i]%10
L=[100,212,310]
print(L)
Quo_Mod(L)
print(L)
SECTION – E
Table : Recipients