Xii CS Hy 24
Xii CS Hy 24
9. If a table which has one Primary key and two alternate keys. How many
Candidate keys will this table have?
(1)
(A) 1 (B) 2 (C) 3 (D) 4
12. Which SQL command can change the degree of an existing relation? (1)
16. Which aggregate function can be used to find the cardinality of a table? (1)
(A) sum() (B) count() (C) avg() (D) max()
17. Which protocol is used to transfer files over the Internet? (1)
(A) HTTP (B) FTP (C) PPP (D) HTTPS
Which network device is used to connect two networks that use different (1)
18.
protocols?
(A) Modem (B) Gateway (C) Switch (D) Repeater
19. Which switching technique breaks data into smaller packets for
transmission, allowing multiple packets to share the same network (1)
resources.
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 (A): If numeric data are to be written to a text file, the data needs
to be converted into a string before writing to the file.
Reasoning (R): write() method takes a string as an argument and writes it (1)
to the text file.
21. Assertion (A): A SELECT command in SQL can have both WHERE and
HAVING clauses.
Reasoning (R): WHERE and HAVING clauses are used to check (1)
conditions, therefore, these can be used interchangeably.
Q No Section-B ( 7 x 2=14 Marks) Marks
22. How is a mutable object different from an immutable object in Python?
Identify one mutable object and one immutable object from the following: (2)
(1,2), [1,2], {1:1,2:2}, ‘123’
23. Give two examples of each of the following: (2)
(I) Arithmetic operators (II) Relational operators
If L1=[1,2,3,2,1,2,4,2, . . . ], and L2=[10,20,30, . . .], then
24. (Answer using builtin functions only)
(I)
A) Write a statement to count the occurrences of 4 in L1.
OR (2)
B) Write a statement to sort the elements of list L1 in ascending
order.
(II)
A) Write a statement to insert all the elements of L2 at the end of L1.
OR
B) Write a statement to reverse the elements of list L2.
25. Identify the correct output(s) of the following code. Also write the minimum
and the maximum possible values of the variable b.
import random
a="Wisdom"
b=random.randint(1,6)
(2)
for i in range(0,b,2):
print(a[i],end='#')
The code provided below is intended to swap the first and last elements of
26. a given tuple. However, there are syntax and logical errors in the code.
Rewrite it after removing all errors. Underline all the corrections made.
def swap_first_last(tup)
if len(tup) < 2:
return tup
new_tup = (tup[-1],) + tup[1:-1] + (tup[0])
(2)
return new_tup
27. (I)
A) What constraint should be applied on a table column so that duplicate
values are not allowed in that column, but NULL is allowed.
OR
B) What constraint should be applied on a table column so that NULL is
not allowed in that column, but duplicate values are allowed. (2)
(II)
A) Mr Atharva is given task to create a database ADMIN. He has to
create a table USERS with following columns:
User_id int
User_name varchar(20)
Password – varchar(10)
Help him complete the two tasks.
OR
(B) Ms Anamika is given task to work on table Student having columns stud_id,
name,class and stream. She has to delete a record named Rahul having
stud)id 100 from table and add another student who took recently
admission with details:
Stud_id 123
Name Rajeev
Class 12
Stream Science
Help her complete the two tasks.
Section-C ( 3 x 3 = 9 Marks)
29. A) Write a Python function that displays all the words containing @gmail
from a text file "Emails.txt".
OR (3)
B) Write a Python function that finds and displays all the words longer than5
characters from a text file "Words.txt".
A dictionary d_city contains the records in the following format: (3)
30
{state: city}
Define the following functions with the given specifications:
i) Push_city(d_city): it takes the dictionary as an argument and pushes all
the cities in the stack CITY whose states are of more than 4 characters.
ii) Pop_city(): this function pops the cities and displays “Stack empty” when
no more cities in the stack.
State the output of the following code: (3)
31
s='India Growing'
n=len(s)
m=''
for i in range(0,n):
if(s[i]>='a' and s[i] <='m'):
m=m+s[i].upper()
elif (s[i] >='o' and s[i] <='z'):
m=m+s[i-1]
elif (s[i].isupper()):
m=m+s[i].lower()
else:
m=m+'@'
print(m)
Q No. Section-D ( 4 x 4 = 16 Marks) Marks
35
(4)
36.
(1+4)
37. Logistic Technologies Ltd. is a Delhi based organization which is expanding its
office set-up to Ambala. At Ambala office campus, they are planning to have 3
different blocks for HR, Accounts and Logistics related work. Each block has a
number of computers, which are required to be connected to a network for
communication, data and resource sharing.
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 block/locations and other given parameters.