0% found this document useful (0 votes)
33 views8 pages

Cs Xii Ms pb2 Set1

Uploaded by

vasantabaria1988
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views8 pages

Cs Xii Ms pb2 Set1

Uploaded by

vasantabaria1988
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

के�ीय िव�ालय संगठन आगरा संभाग

ि�तीय प्री बोड� परी�ा-2024-25


KENDRIYA VIDYALAYA SANGATHAN AGRA REGION
Second Pre Board Examination-2024-25
CLASS: XII
COMPUTER SCIENCE (083)
Time allowed: 3 Hours Maximum Marks: 70

MARKING SCHEME

Q Section-A (21 x 1 = 21 Marks) Marks


No. ( 1 Mark for Correct answer)
1 True 1
2 (d) nvclr 1
3 (a) True 1
4 (a) ('Python is awesome ', '!', ' learn coding') 1
5 (a) MISSI#SIPPI 1
6 (b) Tup.insert(2,3) 1
7 False 1
8 (b) length() 1
9 (c) A primary key can have null values but not duplicate values. 1

10 (c) f.seek(0) 1
11 False 1
12 (b) 300 1
200
13 ALTER 1
14 (c) Details of all employees with "abc" anywhere in their name. 1
15 (b) 25000 1
16 (a) SELECT * FROM Employee WHERE salary > 30000; 1
17 Modem 1
18 (b) POP3 1
19 (b) High delay and variable transmission rates 1
20 (B) Both A and R are true and R is not the correct explanation for A. 1
21 (D) A is False but R is True

Q Section-B ( 7 x 2=14 Marks) Marks


No.
22 [] & [25, 20, 15, 10] 2

23 Examples of Logical and Membership Operators: 2

• (i) Logical Operator:


1. and - Returns True if both operands are true.
2. or - Returns True if at least one of the operands is true.
• (ii) Membership Operator:
1. in - Returns True if the value is found in the sequence.
2. not in - Returns True if the value is not found in the sequence.

24 (I) A) To find the number of elements in L1: 2

len(L1)

(I) B) To arrange the elements of L1 in descending order:

L1.sort(reverse=True)
OR

(II) A) To insert all elements of L2 at the end of L1:

L1.extend(L2)

(II) B) To remove the element at index 5 in L2:

L2.pop(5)

25 Maximum and Minimum Values for T: 2

• Maximum: 4 (since T can be randomly selected between 0 and 4).


• Minimum: 0.

POSSIBLE OUTPUT(S):

(i)75#15# (ii) 75#


26 • Primary Key: 2
o A column (or a combination of columns) that uniquely
identifies each record in a table.
o A table can only have one primary key.
o It cannot have NULL values.
• Candidate Key:
o A column (or a combination of columns) that could uniquely
identify each record.
o A table can have multiple candidate keys.
o Candidate keys can potentially have NULL values unless
specified otherwise.

27 (i) A) To apply a constraint so that no column can have NULL values except 2
for one row, a possible solution could be:

ALTER TABLE table_name MODIFY column_name NOT NULL;

(ii) B) To apply a constraint for a predefined value when no value is


provided by the user:

ALTER TABLE table_name MODIFY column_name DEFAULT


'predefined_value';

(ii) A) To remove the Primary Key constraint:

ALTER TABLE STUDENT DROP PRIMARY KEY;

(ii) B) To make the column Rno the Primary Key:

ALTER TABLE STUDENT ADD PRIMARY KEY (Rno);

28 • Coaxial Cable: 2
o Uses copper to transmit data.
o Suitable for short-distance communication.
o More prone to electromagnetic interference.
• Optical Fiber:
o Uses light to transmit data.
o Provides faster speeds over longer distances.
o Immune to electromagnetic interference.

OR

Devices:

• Modem: Converts digital signals to analog signals for transmission


over telephone lines.
• Repeater: Amplifies signals to extend the range of communication.

Q Section-C ( 4 x 3 = 12 Marks) Marks


No.
29 (i) To display lines with at least 5 words: 3

Def display_lines_with_five_words():
with open('Result.txt', 'r') as file:
for line in file:
if len(line.split()) >= 5:
print(line.strip())

OR

(ii) Function to count "The" in "Book.txt":

def counting():
count = 0
with open('Book.txt', 'r') as file:
for line in file:
count += line.split().count('The')
print(count)
30 (i) Push students with marks > 90: 3

def push_star(StarStudents, AllStudents):

for student in AllStudents:


if student['marks'] > 90:
StarStudents.append(student)

(ii) Pop the topmost student from the stack:

def pop_star(StarStudents):
if StarStudents:
return StarStudents.pop()
else:
print("Underflow")

(iii) Peek the topmost student:

def peek_star(StarStudents):
if StarStudents:
print(StarStudents[-1])
else:
print("None")

31 15@ 2+1
7@
9@

OR

1#2#3#
1#2#3#
1#
32 • i) To display total quantity sold in Qtr 3: 3

SELECT SUM(QSold) FROM WSale WHERE Qtr = 3;

• ii) To display details of watches in descending order of quantity:

SELECT * FROM Watches ORDER BY Qty DESC;

• iii) To display total quantity of watches:

SELECT SUM(Qty) FROM Watches;

• iv) To display wname and maximum qsold in Qtr=1:

SELECT MAX(QSold) FROM Watches, WSale WHERE Watches.Id =


WSale.Wid AND Qtr = 1;
OR
i) Sum(price)
6290
ii)
Id Wname Price Type Qty
W01 High Time 1200 Common 75
W02 Life line 1600 Gents 150
W03 Wave 780 Common 240

iii) sum(qty) type


315 Common
610 Gents
250 Ladies

iv)
Wname Price Qtr
High Time 1200 1
Wave 780 3

Q Section-D ( 2 x 4 = 08 Marks) Marks


No.
33 i) CSV vs Binary Files: 4

• CSV Files store data in a plain text format with values separated by
commas.
• Binary Files store data in a non-human-readable format and are
typically more efficient for large data storage.

ii) def search_employees():


with open('emp.dat', 'rb') as file:
records = pickle.load(file)
for record in records:
if record[2] > 5000:
print(record)
34 (I) Select * from Departments where Date_Join < ’01-01-2010; 4
(II) Select D_name, D_Incharge from Departments where D_Incharge
like ‘%m%;
(III) Update Departments set grant=grant+1200 where D_No in (‘D99’,
‘D23’);
(IV) D_name grant
Primary Null
OR
sum(grant)

34000

Q Section-E ( 3 x 5 = 15 Marks) Marks


No.
35 import mysql.connector as mc 5
con1=mc.connect(host=’localhost’,user=’root’,passwd=’play’,database=’S
PORTS’)
cur1=con1.cursor()
# Insert new record
rank = input("Enter Rank: ")
name = input("Enter Name: ")
dob = input("Enter DOB (YYYY-MM-DD): ")
runs = int(input("Enter Runs: "))
avg = float(input("Enter Average: "))
cur1.execute("INSERT INTO CRICKETERS (Rank, Name, DOB, Runs,
Average) VALUES (%s, %s, %s, %s, %s)", (rank, name, dob, runs, avg))
con1.commit()
query=”select * from CRICKETERS where runs>5000”
cur1.execute(query)
data=cur1.fetchall()
for d in data:
print(d)
con1.close()
36 i) import csv 5
with open(“Employment.csv”, mode='r') as file:
reader = csv.reader(file)
for row in reader:
if int(row[1]) > 5000000:
print(row)
ii) record_count = 0
with open(“Employment.csv”, mode='r') as file:
reader = csv.reader(file)
for row in reader:
record_count += 1
print(record_count)
37 (a) Star with ADMIN as center 5
(b) ADMIN block due to maximum number of computers in any block
(c) i) Switch/Hub: In every block which has more than 1 device to
interconnect them
ii) Repeater: Between ADMIN and SALES to regenerate the weak
signal as distance is over 80m
(d) Ethernet cable
(e) WAN
OR
Video conferencing

You might also like