Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
313 views

Selfstudys Com File

Uploaded by

Erva Savaliya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
313 views

Selfstudys Com File

Uploaded by

Erva Savaliya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Series &RQPS/S Set-4

>
Q.P. Code 91/S

Roll No. Candidates must write the Q.P. Code


on the title page of the answer-book.

COMPUTER SCIENCE

Time allowed : 3 hours Maximum Marks : 70

NOTE
(I) Please check that this question paper contains 15 printed pages.

(II) Please check that this question paper contains 35 questions.

(III) Q.P. Code given on the right hand side of the question paper should be written on
the title page of the answer-book by the candidate.

(IV) Please write down the serial number of the question in the answer-book
before attempting it.

(V) 15 minute time has been allotted to read this question paper. The question paper
will be distributed at 10.15 a.m. From 10.15 a.m. to 10.30 a.m., the students will
read the question paper only and will not write any answer on the answer-book
during this period.

91/S 1 P.T.O.
General Instructions :
Please read the instructions carefully.
· This question paper has 5 Sections : Sections A, B, C, D, E.
· All questions are compulsory. However, an internal choice of approximately
30% is provided.
· Section A has 18 questions carrying 1 mark each.
· Section B has 7 Very Short Answer (VSA) type questions carrying 2 marks
each.
· Section C has 5 Short Answer (SA) type questions carrying 3 marks each.
· Section D has 2 Long Answer (LA) type question carrying 4 marks.
· Section E has 3 Source-based/Case-based/Passage-based questions carrying
5 marks each.

SECTION A 18´1=18
1. State True or False : 1
“In Python, tuple is a mutable data type”.

2. The primary key is selected from the set of ___________ . 1


(A) composite keys (B) alternate keys
(C) candidate keys (D) foreign keys

3. What will be the output of the following statement ? 1


print(6+5/4**2//5+8)
(A) –14.0 (B) 14.0

(C) 14 (D) –14

4. Select the correct output of the code : 1


S = "text#next"
print(S.strip("t"))
(A) ext#nex (B) ex#nex
(C) text#nex (D) ext#next

91/S 2
5. In SQL, which command will be used to add a new record in a table ? 1
(A) UPDATE
(B) ADD
(C) INSERT
(D) ALTER TABLE

6. ‘L’ in HTML stands for : 1


(A) Large (B) Language
(C) Long (D) Laser

7. Identify the valid Python identifier from the following : 1

(A) 2user (B) user@2

(C) user_2 (D) user 2

8. Consider the statements given below and then choose the correct output
from the given options : 1
Game="World Cup 2023"
print(Game[-6::-1])

(A) CdrW (B) ce o

(C) puC dlroW (D) Error

9. Predict the output of the following Python statements : 1


>>>import statistics as s
>>>s.mode ([10, 20, 10, 30, 10, 20, 30])
(A) 30
(B) 20
(C) 10
(D) 18.57

91/S 3 P.T.O.
10. Which of the following output will never be obtained when the given code
is executed ? 1
import random
Shuffle = random.randrange(10)+1
Draw = 10*random.randrange(5)
print ("Shuffle", Shuffle, end="#")
print ("Draw", Draw)
(A) Shuffle 1 # Draw 0
(B) Shuffle 10 # Draw 10
(C) Shuffle 10 # Draw 0
(D) Shuffle 11 # Draw 50

11. Ethernet card is also known as : 1


(A) LIC (B) MIC
(C) NIC (D) OIC

12. What will be the output of the given code ? 1


a=10
def convert(b=20):
a=30
c=a+b
print(a,c)
convert(30)
print(a)

13. For the following Python statement : 1


N = (25)
What shall be the type of N ?
(A) Integer
(B) String
(C) Tuple
(D) List
91/S 4
14. Mr. Ravi is creating a field that contains alphanumeric values and fixed
lengths. Which MySQL data type should he choose for the same ? 1
(A) VARCHAR
(B) CHAR
(C) LONG
(D) NUMBER

15. Fill in the blank : 1

The full form of WWW is __________.

16. __________ files are stored in a computer in a sequence of bytes. 1


(A) Text
(B) Binary
(C) CSV
(D) Notepad

Questions No.17 and 18 are Assertion and Reason type questions. Each question
consists of two statements, namely, Assertion (A) and Reason (R). Select the most
suitable option considering the Assertion and Reason.
17. Assertion (A) : Global variables are accessible in the whole program. 1
Reason (R) : Local variables are accessible only within a function or block
in which it is declared.

(A) Both Assertion (A) and Reason (R) are true and Reason (R) is the
correct explanation of Assertion (A).

(B) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the
correct explanation of Assertion (A).

(C) Assertion (A) is true, but Reason (R) is false.

(D) Assertion (A) is false, but Reason (R) is true.

91/S 5 P.T.O.
18. 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. 1
Reason (R) : write() method takes a string as an argument and writes it
to the text file.
(A) Both Assertion (A) and Reason (R) are true and Reason (R) is the
correct explanation of Assertion (A).
(B) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the
correct explanation of Assertion (A).
(C) Assertion (A) is true, but Reason (R) is false.
(D) Assertion (A) is false, but Reason (R) is true.

SECTION B 7´2=14
19. (a) (i) Expand the following terms : 1+1=2
URL, XML

(ii) Give one difference between HTTP and FTP.


OR

(b) (i) Define the term IP address with respect to network.

(ii) What is the main purpose of a Router ? 1+1=2

20. Observe the following code carefully and rewrite it after removing
all syntactical errors. Underline all the corrections made. 2
def 1func():
a=input("Enter a number"))
if a>=33
print("Promoted to next class")
ELSE:
print("Repeat")

91/S 6
21. (a) Write the definition of a method/function SearchOut(Teachers,
TName) to search for TName from a list Teachers, and display the
position of its presence. 2
For example :
If the Teachers contain ["Ankit", "Siddharth", "Rahul",
"Sangeeta", "rahul"]
and TName contains "Rahul"
The function should display
Rahul at 2
rahul at 4

OR

(b) Write the definition of a method/function Copy_Prime(lst) to copy


all the prime numbers from the list lst to another list lst_prime. 2

22. Predict the output of the following code : 2


d={"IND":"DEL","SRI:"COL","CHI":"BEI"}
str1=""
for i in d:
str1=strl+str(d[i])+"@"
str2=str1[:–1]
print (str2)

23. (a) Write the Python statement for each of the following tasks using
BUILT-IN functions/methods only : 1+1=2
(i) To delete an element 10 from the list lst.
(ii) To replace the string "This" with "That" in the string str1.
OR
(b) A dictionary dict2 is copied into the dictionary dict1 such that the
common key’s value gets updated. Write the Python commands to do
the task and after that empty the dictionary dict1. 2

91/S 7 P.T.O.
24. (a) Mr. Atharva is given a task to create a database, Admin. He has to
create a table, users in the database with the following columns : 1+1=2
User_id – int
User_name – varchar(20)
Password – varchar(10)
Help him by writing SQL queries for both tasks.

OR

(b) Ms. Rita is a database administrator at a school. She is working on


the table, student containing the columns like Stud_id, Name,
Class and Stream. She has been asked by the Principal to strike off
the record of a student named Rahul with student_id as 100 from
the school records and add another student who has been admitted
with the following details : 1+1=2
Stud_id – 123
Name – Rajeev
Class – 12
Stream – Science
Help her by writing SQL queries for both tasks.

25. Predict the output of the following code : 2


def Total (Num=10):
Sum=0
for C in range(1,Num+1):
if C%2!=0:
continue
Sum+=C
return Sum
print(Total(4),end="$")
print(Total(),sep="@")

91/S 8
SECTION C 5´3=15
26. Predict the output of the Python code given below : 3
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)

27. Consider the table Stationery given below and write the output of the
SQL queries that follow. 3
Table : Stationery
ITEMNO ITEM DISTRIBUTOR QTY PRICE
401 Ball Pen 0.5 Reliable Stationers 100 16
402 Gel Pen Premium Classic Plastics 150 20
403 Eraser Big Clear Deals 210 10
404 Eraser Small Clear Deals 200 5
405 Sharpener Classic Classic Plastics 150 8
406 Gel Pen Classic Classic Plastics 100 15

(i) SELECT DISTRIBUTOR, SUM(QTY) FROM STATIONERY GROUP


BY DISTRIBUTOR;

(ii) SELECT ITEMNO, ITEM FROM STATIONERY WHERE


DISTRIBUTOR = "Classic Plastics" AND PRICE > 10;

(iii) SELCET ITEM, QTY * PRICE AS "AMOUNT" FROM STATIONERY


WHERE ITEMNO = 402;
91/S 9 P.T.O.
28. (a) Write a method/function COUNTWORDS() in Python to read contents
from a text file DECODE.TXT, to count and return the occurrence of
those words, which are having 5 or more characters. 3

OR

(b) Write a method/function COUNTLINES() in Python to read lines from


a text file CONTENT.TXT, and display those lines, which have
@ anywhere in the line. 3

For example :
If the content of the file is :
Had an amazing time at the concert last night with
@MusicLoversCrew.
Excited to announce the launch of our new website!
G20 @ India

The method/function should display


Had an amazing time at the concert last night with
@MusicLoversCrew
G20 @ India

29. Consider the table Rent_cab, given below :


Table : Rent_cab
Vcode VName Make Color Charges
101 Big car Carus White 15
102 Small car Polestar Silver 10
103 Family car Windspeed Black 20
104 Classic Studio White 30
105 Luxury Trona Red 9

Based on the given table, write SQL queries for the following : 3

(i) Add a primary key to a column name Vcode.

(ii) Increase the charges of all the cabs by 10%.

(iii) Delete all the cabs whose maker name is "Carus".

91/S 10
30. A dictionary, d_city contains the records in the following format :
{state:city}
Define the following functions with the given specifications : 3
(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 there are no more cities in the stack.

SECTION D 2´4=8

31. Consider the tables GAMES and PLAYERS given below :

Table : GAMES
GCode GameName Type Number PrizeMoney
101 Carrom Board Indoor 2 5000
102 Badminton Outdoor 2 12000
103 Table Tennis Indoor 4 NULL
104 Chess Indoor 2 9000
105 Lawn Tennis Outdoor 4 25000

Table : PLAYERS
PCode Name GCode
1 Nabi Ahmad 101
2 Ravi Sahai 108
3 Jatin 101
4 Nazneen 103
Write SQL queries for the following : 4
(i) Display the game type and average number of games played in each
type.
(ii) Display prize money, name of the game, and name of the players from
the tables Games and Players.
(iii) Display the types of games without repetition.
(iv) Display the name of the game and prize money of those games whose
prize money is known.

91/S 11 P.T.O.
32. Mr. Mahesh is a Python Programmer working in a school. He has to
maintain the records of the sports students. He has created a csv file
named sports.csv, to store the details. The structure of sports.csv is :
[sport_id, competition, prize_won]
where
sport_id, is Sport id (integer)
competition is competition name (string)
prize_won is (“Gold”, “Silver”, “Bronze”)
Mr. Mahesh wants to write the following user-defined functions :
Add_detail(): to accept the detail of a student and add to a csv file,
"sports.csv".
Count_Medal(): to display the name of competitions in which students
have won "Gold" medal.
Help him in writing the code of both the functions. 4

SECTION E 3´5=15

33. 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.

91/S 12
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.
Distances between various blocks/locations :

HR Block to Accounts Blocks 400 meters

Accounts Block to Logistics Block 200 meters

Logistics Block to HR Block 150 meters

Delhi Head Office to Ambala Office 220 Km


Number of computers installed at various blocks are as follows :

HR Block 70
Accounts Block 40
Logistics Block 30

(i) Suggest the most appropriate block/location to house the SERVER in


the Ambala office. Justify your answer.

(ii) Suggest the best wired medium to efficiently connect various blocks
within the Ambala office compound.

(iii) Draw an ideal cable layout (Block to Block) for connecting these blocks
for wired connectivity.

(iv) The company wants to schedule an online conference between the


managers of Delhi and Ambala offices. Which protocol will be used for
effective voice communication over the Internet ?

(v) Which kind of network will it be between Delhi office and Ambala
office ? 5

91/S 13 P.T.O.
34. (a) (i) What is the main purpose of seek() and tell() method ?
(ii) Consider a binary file, Cinema.dat containing information in
the following structure :
[Mno, Mname, Mtype]
Write a function, search_copy(), that reads the content from
the file Cinema.dat and copies all the details of the "Comedy"
movie type to file named movie.dat. 5
OR
(b) (i) Give one difference between write() and writeline()
function in text file.
(ii) A Binary file, "Items.dat" has the following structure :
[Icode, Description, Price]
Where
Icode – Item code
Description – Detail of item
Price – Price of item
Write a function Add_data(), that takes Icode,
Description and Price from the user and writes the
information in the binary file "Items.dat". 5
35. (a) (i) Define the term foreign key with respect to RDBMS.
(ii) Sangeeta wants to write a program in Python to delete the
record of a candidate “Raman” from the table named
Placement in MySQL database, Agency:
The table Placement in MySQL contains the following
attributes :
CName – String
Dept – String
Place – String
Salary – integer
Note the following to establish connectivity between Python
and MySQL :
· Username – root
· Password – job
· Host – localhost
Help Sangeeta to write the program in Python for the above
mentioned task. 5
OR

91/S 14
(b) (i) Give one difference between CHAR and VARCHAR datatype in
MySQL.
(ii) Rahim wants to write a program in Python to insert the
following record in the table named Bank_Account in MySQL
database, Bank :
· Accno – integer
· Cname – string
· Atype – string
· Amount – float
Note the following to establish connectivity between Python
and MySQL :
· Username – admin
· Password – root
· Host – localhost
The values of fields Accno, Cname, Atype and Amount have
to be accepted from the user. Help Rahim to write the program
in Python. 5

91/S 15 P.T.O.
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
Marking Scheme
Strictly Confidential
(For Internal and Restricted use only)
Senior Secondary School Certificate Examination, 2024
Subject Name: Computer Science (Q.P. CODE 91/S)
1 You are aware that evaluation is the most important process in the actual and correct
assessment of the candidates. A small mistake in evaluation may lead to serious problems which
may affect the future of the candidates, education system and teaching profession. To avoid
mistakes, it is requested that before starting evaluation, you must read and understand the spot
evaluation guidelines carefully.

2 “Evaluation policy is a confidential policy as it is related to the confidentiality of the


examinations conducted, Evaluation done and several other aspects. Its’ leakage to the public in
any manner could lead to derailment of the examination system and affect the life and future of
millions of candidates. Sharing this policy/document to anyone, publishing in any magazine and
printing in News Paper/Website etc. may invite action under various rules of the Board and IPC.”

3 Evaluation is to be done as per instructions provided in the Marking Scheme. It should not be
done according to one’s own interpretation or any other consideration. Marking Scheme should
be strictly adhered to and religiously followed. However, while evaluating answers which are
based on latest information or knowledge and/or are innovative, they may be assessed for their
correctness otherwise and due marks be awarded to them. In class-XII, while evaluating two
competency-based questions, please try to understand the given answer and even if the reply is
not from the marking scheme but correct competency is enumerated by the candidate, due
marks should be awarded.

4 The Marking scheme carries only suggested value points for the answers
These are in the nature of Guidelines only and do not constitute the complete answer. The
students can have their own expression and if the expression is correct, the due marks should be
awarded accordingly.

5 The Head-Examiner must go through the first five answer books evaluated by each evaluator on
the first day, to ensure that evaluation has been carried out as per the instructions given in the
Marking Scheme. If there is any variation, the same should be zero after deliberation and
discussion. The remaining answer books meant for evaluation shall be given only after ensuring
that there is no significant variation in the marking of individual evaluators.

6 Evaluators will mark( √ ) wherever the answer is correct. For wrong answers CROSS ‘X’ be
marked. Evaluators will not put right (✓)while evaluating which gives an impression that the
answer is correct and no marks are awarded. This is the most common mistake which evaluators
are committing.

7 If a question has parts, please award marks on the right-hand side for each part. Marks awarded
for different parts of the question should then be totaled up and written in the left-hand margin
and encircled. This may be followed strictly.

8 If a question does not have any parts, marks must be awarded in the left-hand margin and
encircled. This may also be followed strictly.

9 If a student has attempted an extra question, the answer of the question deserving more marks
should be retained and the other answer scored out with a note “Extra Question”.

10 No marks to be deducted for the cumulative effect of an error. It should be penalized only once.

11 A full scale of 70 marks as given in Question Paper has to be used. Please do not hesitate to
award full marks if the answer deserves it.

Page 1/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
12 Every examiner has to necessarily do evaluation work for full working hours i.e., 8 hours every
day and evaluate 20 answer books per day in main subjects and 25 answer books per day in other
subjects (Details are given in Spot Guidelines).This is in view of the reduced syllabus and number
of questions in question paper.

13 Ensure that you do not make the following common types of errors committed by the Examiner
in the past:-
● Leaving the answer or part thereof unassessed in an answer book.
● Giving more marks for an answer than assigned to it.
● Wrong totaling of marks awarded on an answer.
● Wrong transfer of marks from the inside pages of the answer book to the title page.
● Wrong question wise totaling on the title page.
● Wrong totaling of marks of the two columns on the title page.
● Wrong grand total.
● Marks in words and figures not tallying/not same.
● Wrong transfer of marks from the answer book to online award list.
● Answers marked as correct, but marks not awarded. (Ensure that the right tick mark is
correctly and clearly indicated. It should merely be a line. Same is with the X for incorrect
answers.)
● Half or a part of the answer was marked correct and the rest was wrong, but no marks were
awarded.

14 While evaluating the answer books, if the answer is found to be totally incorrect, it should be
marked as cross (X) and awarded zero (0)Marks.

15 Any unassessed portion, non-carrying over of marks to the title page, or totaling error detected
by the candidate shall damage the prestige of all the personnel engaged in the evaluation work
as also of the Board. Hence, in order to uphold the prestige of all concerned, it is again
reiterated that the instructions be followed meticulously and judiciously.

16 The Examiners should acquaint themselves with the guidelines given in the “Guidelines for Spot
Evaluation” before starting the actual evaluation.

17 Every Examiner shall also ensure that all the answers are evaluated, marks carried over to the
title page, correctly totaled and written in figures and words.

18 The candidates are entitled to obtain a photocopy of the Answer Book on request on payment of
the prescribed processing fee. All Examiners/Additional Head Examiners/Head Examiners are
once again reminded that they must ensure that evaluation is carried out strictly as per value
points for each answer as given in the Marking Scheme.
SPECIFIC INSTRUCTIONS FOR COMPUTER SCIENCE ONLY
1 In Python, string content is accepted within a pair of single quotes ' ' or within a pair of
double quotes " ".

2 In MySQL, CHAR/VARCHAR/DATE type content is accepted within a pair of single quotes ' ' or
within a pair of double quotes " ".

3 In MySQL commands, lowercase/UPPERCASE both are correct.

4 In MySQL output questions, column headings to be ignored.

5 In MySQL output questions, alignment (left/right) of content to be ignored.

6 All answers/codes are suggestive, any other alternative correct answers to be accepted.

Page 2/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
General Instructions:
Please read the instructions carefully.
● This question paper has 5 Sections: Sections A,B,C,D,E.
● All questions are compulsory. However, an internal choice of approximately 30% is provided.
● Section A has 18 questions carrying 1 mark each.
● Section B has 7 Very Short Answer(VSA) type questions carrying 2 marks each.
● Section C has 5 Short Answer(SA) type questions carrying 3 marks each.
● Section D has 2 Long Answer(LA) type questions carrying 4 marks.
● Section E has 3 Source-based/ Case-based/Passage-based questions carrying 5 marks each.

SECTION A 18x1=18

1. State True or False : 1


“In Python, tuple is a mutable data type”.

Ans False

(1 Mark for the correct answer)

2. The primary key is selected from the set of ___________ . 1

(A) composite keys (B) alternate keys

(C) candidate keys (D) foreign keys

Ans (C) candidate keys

(1 Mark for the correct answer)

3. What will be the output of the following statement ? 1


print(6+5/4**2//5+8)

(A) –14.0 (B) 14.0

(C) 14 (D) –14

Ans (B) 14.0

(1 Mark for the correct answer)

4. Select the correct output of the code: 1


S = "text#next"
print(S.strip("t"))
(A) ext#nex (B) ex#nex

(C) text#nex (D) ext#next

Ans (A) ext#nex

(1 Mark for the correct answer)

Page 3/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
5. In SQL, which command will be used to add a new record in a table ? 1
(A) UPDATE (B) ADD

(C) INSERT (D) ALTER TABLE

Ans (C) INSERT

(1 Mark for the correct answer)

6. ‘L’ in HTML stands for : 1


(A) Large (B) Language

(C) Long (D) Laser

Ans (B) Language

(1 Mark for the correct answer)

7. Identify the valid Python identifier from the following : 1


(A) 2user (B) user@2

(C) user_2 (D) user 2

Ans (C) user_2

(1 Mark for the correct answer)

8. Consider the statements given below and then choose the correct output from the given 1
options :
Game="World Cup 2023"
print(Game[-6::-1])

(A) CdrW (B) ce o

(C) puC dlroW (D) Error

Ans (C) puC dlroW

(1 Mark for the correct answer)

9. Predict the output of the following Python statements : 1


>>>import statistics as s
>>>s.mode ([10, 20, 10, 30, 10, 20, 30])

(A) 30 (B) 20

(C) 10 (D) 18.57

Ans (C) 10

(1 Mark for the correct answer)

Page 4/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
10. Which of the following output will never be obtained when the given code is executed ? 1
import random
Shuffle = random.randrange(10)+1
Draw = 10*random.randrange(5)
print ("Shuffle", Shuffle, end="#")
print ("Draw", Draw)
(A) Shuffle 1 # Draw 0 (B) Shuffle 10 # Draw 10

(C) Shuffle 10 # Draw 0 (D) Shuffle 11 # Draw 50

Ans (D) Shuffle 11 # Draw 50

(1 Mark for the correct answer)

11. Ethernet card is also known as : 1


(A) LIC (B) MIC

(C) NIC (D) OIC

Ans (C) NIC

(1 Mark for the correct answer)

12. What will be the output of the given code ? 1


a=10
def convert(b=20):
a=30
c=a+b
print(a,c)
convert(30)
print(a)

Ans 30 60
10

( ½ Mark for each line of the output)

13. For the following Python statement : 1


N = (25)
What shall be the type of N ?

(A) Integer (B) String

(C) Tuple (D) List

Ans (A) Integer

(1 Mark for the correct answer)

14. Mr. Ravi is creating a field that contains alphanumeric values and fixed lengths. Which 1
MySQL data type should he choose for the same ?
(A) VARCHAR (B) CHAR

(C) LONG (D) NUMBER

Page 5/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
Ans (B) CHAR

(1 Mark for the correct answer)

15. Fill in the blank : 1

The full form of WWW is __________.

Ans World Wide Web

(1 Mark for the correct answer)

16. __________ files are stored in a computer in a sequence of bytes. 1


(A) Text (B) Binary

(C) CSV (D) Notepad

Ans (B) Binary

(1 Mark for the correct answer)

Questions No.17 and 18 are Assertion and Reason type questions. Each question consists of two
statements, namely, Assertion (A) and Reason (R). Select the most suitable option considering
the Assertion and Reason.

17 Assertion (A) : Global variables are accessible in the whole program. 1


Reason (R) : Local variables are accessible only within a function or block in which it is
declared.
(A) Both Assertion (A) and Reason (R) are true and Reason (R) is the correct
explanation of Assertion (A).
(B) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct
explanation of Assertion (A).
(C) Assertion (A) is true, but Reason (R) is false.

(D) Assertion (A) is false, but Reason (R) is true.

Ans (B) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct
explanation of Assertion (A).
(1 Mark for the correct answer)

18 Assertion (A) : If numeric data are to be written to a text file, the data needs to be 1
converted into a string before writing to the file.
Reason (R) : write() method takes a string as an argument and writes it to the text file.
(A) Both Assertion (A) and Reason (R) are true and Reason (R) is the correct
explanation of Assertion (A).
(B) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct
explanation of Assertion (A).
(C) Assertion (A) is true, but Reason (R) is false.

(D) Assertion (A) is false, but Reason (R) is true.

Page 6/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
Ans (A) Both Assertion (A) and Reason (R) are true and Reason (R) is the correct
explanation of Assertion (A).
(1 Mark for the correct answer)

Note:
(Full 1 Mark should be given for writing (A) OR (B) as the correct answer)

SECTION B 7x2=14

19 (a) (i) Expand the following terms : 1+1=2

URL, XML

(ii) Give one difference between HTTP and FTP.

Ans (a) (i) Uniform Resource Locator


eXtensible Markup Language

(½ Mark for writing correct expansion of URL)


(½ Mark for writing correct expansion of XML)

Ans (ii)
HTTP FTP
Hypertext Transfer Protocol File Transfer Protocol
HTTP is used for accessing Web pages FTP is used to transfer Files from one computer
to another computer over the internet
OR
Any other correct difference with or without supporting examples.

(1 Mark for writing any one valid difference between HTTP and FTP with or without
supporting example)

OR
(½ Mark for writing anyone correct characteristic for HTTP)
(½ Mark for writing anyone correct characteristic for FTP)

OR

(b) (i) Define the term IP address with respect to network. 1+1=
(ii) What is the main purpose of a Router ? 2

Ans (b) (i) IP Address: It is the unique address for each computer on a network.
(1 Mark for writing correct meaning or any one appropriate purpose of IP address)

(ii) A router is a device that:


1. connects two or more packet-switched networks or subnetworks.
2. manages traffic between networks by forwarding data packets to their intended IP
addresses
3. allows multiple devices to use the same Internet connection.

Page 7/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
(1 Mark for writing correct meaning or any one appropriate purpose of Router)

20. Observe the following code carefully and rewrite it after removing all syntactical 2
errors. Underline all the corrections made.

def 1func():
a=input("Enter a number"))
if a>=33
print("Promoted to next class")
ELSE:
print("Repeat")

Ans def func1(): # Error Correction 1 (or Any other valid correction)
a=int(input("Enter a number")) # Error Correction 2
if a>=33: # Error Correction 3
print("Promoted to next class")
else: # Error Correction 4
print("Repeat")

(½ Mark for each of the four corrections)

21. (a) Write the definition of a method/function SearchOut(Teachers,TName) 2


to search for TName from a list Teachers, and display the position of its
presence.

For example :
If the Teachers contain ["Ankit", "Siddharth", "Rahul",
"Sangeeta", "rahul"]
and TName contains "Rahul"

The function should display


Rahul at 2
rahul at 4

Ans def SearchOut(Teachers, TName):


for I in range(len(Teachers)):
if TName.lower() == Teachers[I].lower():
print(Teachers[I],"at",I)

OR
Any other correct variation of the code

(½ Mark for the loop to process individual names in the list Teachers)
(1 Mark for non-case sensitive correct comparison with Tname)
(½ Mark for printing in correct format)

OR

(b) Write the definition of a method/function Copy_Prime(lst) to copy all the 2


prime numbers from the list lst to another list lst_prime.

Page 8/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
Ans def Copy_Prime(lst):
lst_prime=[]
for L in lst:
for N in range(2,L//2+1): # OR for N in range(2,L**0.5+1):
if L%N==0:
break
else:
lst_prime.append(L)
return lst_prime

OR
Any other correct variation of the code

(½ Mark for the loop to select the number from the list lst)
(1 Mark for correctly identifying prime number)
(½ Mark for appending the prime number in the list lst_prime)

22. Predict the output of the following code : 2


d={"IND":"DEL","SRI:"COL","CHI":"BEI"}
str1=""
for i in d:
str1=strl+str(d[i])+"@"
str2=str1[:–1]
print (str2)

Ans DEL@COL@BEI

OR

Syntax Error as "SRI does not have closing quotes


and str1 and strl are differently typed

(1 Mark for writing DEL COL BEI)


(1 Mark for correct format and placement of @)
OR
(2 Marks for mentioning error in the given code)

23. (a) Write the Python statement for each of the following tasks using BUILT-IN 1+1=2
functions/methods only :
(i) To delete an element 10 from the list lst.
(ii) To replace the string "This" with "That" in the string str1.

Ans (a) (i)


lst.remove(10)
OR
Any other correct Python command using valid BUILT-IN method/function

(1 Mark for writing correct command using valid BUILT-IN method/function)


Note:
● ½ Mark to be awarded if answer is lst.pop(9) or lst.pop(10)

(ii)
str1.replace("This","That")
OR
Any other correct Python command using valid BUILT-IN method/function

(1 Mark for writing correct command using valid BUILT-IN method/function)


Page 9/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
OR

(b) A dictionary dict2 is copied into the dictionary dict1 such that the common 2
key’s value gets updated. Write the Python commands to do the task and after that
empty the dictionary dict1.

Ans (b) dict1.update(dict2)


dict1.clear()

OR
Any other correct variation of the commands

(1 Mark for correctly updating the dictionary dict1 by dict2)


(1 Mark for correctly emptying the dictionary dict1)

24. (a) Mr. Atharva is given a task to create a database, Admin. He has to create a table, 1+1=
users in the database with the following columns : 2

User_id – int
User_name – varchar(20)
Password – varchar(10)

Help him by writing SQL queries for both tasks.

Ans (a) CREATE DATABASE Admin;

CREATE TABLE users


(User_id int,
User_name varchar(20),
Password varchar(10));

(1 Mark for each correct command)

OR

(b) Ms. Rita is a database administrator at a school. She is working on the table, 1+1=
student containing the columns like Stud_id, Name, Class and Stream. 2
She has been asked by the Principal to strike off the record of a student named
Rahul with student_id as 100 from the school records and add another
student who has been admitted with the following details :

Stud_id – 123
Name – Rajeev
Class – 12
Stream – Science

Help her by writing SQL queries for both tasks.

Ans (b) DELETE FROM Student


WHERE Name="Rahul" and Stud_id=100;
OR
DELETE FROM Student
WHERE Name="Rahul" and student_id=100;
OR
Any valid and equivalent SQL query.

Page 10/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
INSERT INTO Student(Stud_id, Name, Class, Stream)
VALUES (123,"Rajeev",12,"Science");
OR
INSERT INTO Student
VALUES (123,"Rajeev",12,"Science");
OR
Any valid and equivalent SQL query.

(1 Mark for each correct SQL query)

25 Predict the output of the following code : 2


def Total(Num=10):
Sum=0
for C in range(1,Num+1):
if C%2!=0:
continue
Sum+=C
return Sum
print(Total(4),end="$")
print(Total(),sep="@")

Ans 6$30

( 1 Mark for each value of correct output)


Note:
Deduct ½ mark only if $ not written correctly

SECTION C 5x3=15

26. Predict the output of the Python code given below : 3


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)

Ans iIDIA@gGroIiG #Considering capital O in the 7th line of code


OR
i@DIA@gGroI@G #Considering small o in the 7th line of code

(1 Mark for correctly writing the part iIDIA or i@DIA)


(1 Mark for correctly placing the character @ at the 5th position )
(1 Mark for correctly writing the part gGroIiG or gGroI@G)
Note:
Deduct only ½ if the output content is correct but written in different lines or
format is incorrect

Page 11/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
27 Consider the table Stationery given below and write the output of the SQL 3
queries that follow.

Table : Stationery
ITEMNO ITEM DISTRIBUTOR QTY PRICE
401 Ball Pen 0.5 Reliable Stationers 100 16
402 Gel Pen Premium Classic Plastics 150 20
403 Eraser Big Clear Deals 210 10
404 Eraser Small Clear Deals 200 5
405 Sharpener Classic Classic Plastics 150 8
406 Gel Pen Classic Classic Plastics 100 15

(i) SELECT DISTRIBUTOR, SUM(QTY) FROM STATIONERY


GROUP BY DISTRIBUTOR;
(ii) SELECT ITEMNO, ITEM FROM STATIONERY
WHERE DISTRIBUTOR = "Classic Plastics" AND PRICE > 10;
(iii) SELCET ITEM, QTY * PRICE AS "AMOUNT" FROM STATIONERY
WHERE ITEMNO = 402;

Ans (i)
DISTRIBUTOR SUM(QTY)
Reliable Stationers 100
Classic Plastics 400
Clear Deals 410
(ii)
ITEMNO ITEM
402 Gel Pen Premium
406 Gel Pen Classic
(iii)
ITEM AMOUNT
Gel Pen Premium 3000

Note (for Part iii only):


Full 1 Mark for identifying Syntax error for wrongly spelt SELECT as SELCET

(1 Mark for writing each correct output)

Note:
● Ignore output heading for part (i) and (ii), however, in part (iii),
mentioning AMOUNT as heading of the second column is a must.
● Ignore order of rows

28 (a) Write a method/function COUNTWORDS() in Python to read contents from a text 3


file DECODE.TXT, to count and return the occurrence of those words, which
are having 5 or more characters.

Page 12/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
Ans def COUNTWORDS():
NW=0
with open("DECODE.TXT",'r') as F:
S=F.read().split()
for W in S:
if len(W)>=5:
NW+=1
return NW
OR
Any other correct variation of the code

( ½ Mark for correctly opening the text file in read mode using any valid
method)
( 1 Mark for processing each word in the text file)
( 1 Mark for counting words having 5 or more characters)
( ½ Mark for returning the desired value)

OR

(b) Write a method/function COUNTLINES() in Python to read lines from a text file 3
CONTENT.TXT, and display those lines, which have @ anywhere in the line.
For example :
If the content of the file is :

Had an amazing time at the concert last night with


@MusicLoversCrew.
Excited to announce the launch of our new website!
G20 @ India

The method/function should display

Had an amazing time at the concert last night with


@MusicLoversCrew
G20 @ India

Ans def COUNTLINES():


f=open("CONTENT.TXT","r")
LS=f.readlines()
for L in LS:
if "@" in L:
print(L)
f.close()

OR
Any other correct variation of the code

( ½ Mark for correctly opening the text file in read mode using any valid
method)
( 1 Mark for processing each line in the text file)
( 1 Mark for checking whether a line contains the character @ or not)
( ½ Mark for displaying the desired line)

Page 13/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
29 Consider the table Rent_cab, given below : 3
Table : Rent_cab
Vcode VName Make Color Charges
101 Big car Carus White 15
102 Small car Polestar Silver 10
103 Family car Windspeed Black 20
104 Classic Studio White 30
105 Luxury Trona Red 9

Based on the given table, write SQL queries for the following :
(i) Add a primary key to a column name Vcode.
(ii) Increase the charges of all the cabs by 10%.
(iii) Delete all the cabs whose maker name is "Carus".

Ans (i) ALTER TABLE Rent_cab


ADD PRIMARY KEY (Vcode);
OR
ALTER TABLE Rent_cab
ADD CONSTRAINT PRIMARY KEY (Vcode);

(½ Mark for ALTER TABLE part)


(½ Mark for ADD PRIMARY KEY part)

(ii) UPDATE Rent_cab


SET Charges=Charges*1.1;
OR
UPDATE Rent_cab
SET Charges=Charges+Charges*10/100

(½ Mark for UPDATE part)


(½ Mark for SET part)

(iii) DELETE FROM Rent_cab


WHERE Make="Carus";

(½ Mark for DELETE command)


(½ Mark for WHERE clause)

30 A dictionary, d_city contains the records in the following format : 3


{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 there are no more cities in the stack.

Ans (i) CITY=[]


def push_city(d_city):
for c in d_city:
if len(c) > 4:
CITY.append(d_city[c])

Page 14/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
(ii) def pop_city():
while CITY:
print(CITY.pop())
else:
print("Stack empty")

OR

Any other correct variation of the code

( ½ Mark for the correct loop in the function push_city)


( ½ Mark for correctly checking the number of chars in the function push_city)
( ½ Mark for pushing the correct cities into CITY in the function push_city)

( ½ Mark for the correct loop in the function pop_city)


( ½ Mark for correctly checking the underflow condition and printing "Stack
Empty" in the function pop_city)
( ½ Mark for correctly popping in the function pop_city)

Note:
Ignore the declaration of CITY

SECTION D 2x4=8

31 Consider the tables GAMES and PLAYERS given below : 4

Table : GAMES
GCode GameName Type Number PrizeMoney
101 Carrom Board Indoor 2 5000
102 Badminton Outdoor 2 12000
103 Table Tennis Indoor 4 NULL
104 Chess Indoor 2 9000
105 Lawn Tennis Outdoor 4 25000

Table : PLAYERS
PCode Name GCode
1 Nabi Ahmad 101
2 Ravi Sahai 108
3 Jatin 101
4 Nazneen 103
Write SQL queries for the following :

(i) Display the game type and average number of games played in each type.

Ans SELECT Type, AVG(Number) FROM GAMES


GROUP BY Type;
OR
Any other correct equivalent query using/without using join

Page 15/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
(½ Mark for SELECT - FROM part)
(½ Mark for GROUP BY part)

(ii) Display prize money, name of the game, and name of the players from the tables
Games and Players.

Ans SELECT PrizeMoney, GameName, Name FROM GAMES, PLAYERS


WHERE GAMES.GCode=PLAYERS.GCode;

(½ Mark for SELECT - FROM part)


(½ Mark for WHERE part)

(iii) Display the types of games without repetition.

Ans SELECT DISTINCT TYPE FROM GAMES;


OR
Any other correct equivalent query with/without using join

( 1 Mark for correct command)

(iv) Display the name of the game and prize money of those games whose prize money
is known.

Ans SELECT GameName, PrizeMoney FROM GAMES


WHERE PrizeMoney IS NOT NULL;
OR
Any other correct equivalent query with/without using join

(½ Mark for SELECT - FROM part)


(½ Mark for WHERE part)

32 Mr. Mahesh is a Python Programmer working in a school. He has to maintain the 4


records of the sports students. He has created a csv file named sports.csv, to
store the details.The structure of sports.csv is :
[sport_id, competition, prize_won]
where
sport_id, is Sport id (integer)
competition is competition name (string)
prize_won is ("Gold", "Silver", "Bronze")

Mr. Mahesh wants to write the following user-defined functions :


Add_detail(): to accept the detail of a student and add to a csv file,
"sports.csv".
Count_Medal(): to display the name of competitions in which students have
won "Gold" medal.

Help him in writing the code of both the functions.

Ans import csv


def Add_detail():
F=open("sports.csv","a")
W=csv.writer(F)
sport_id=int(input("Sport id:"))
competition=input("Competition:")
prize_won=input("Prize won:")

Page 16/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
L=[sport_id,competition,prize_won]
W.writerow(L)
F.close()

def Count_Medal():
F=open("sports.csv","r")
L=list(csv.reader(F))
for D in L:
if D[2]=="Gold":
print("Competition:",D[1])
F.close()

OR
Any other correct variation of the code

(½ Mark for opening the csv file correctly in the function Add_detail())
(½ Mark for reading the data from the user in the function Add_detail())
(½ Mark for writing the data correctly into the csv file in the function
Add_detail())

(½ Mark for opening the csv file correctly in the function Count_Medal())
(½ Mark for reading the data from the file in the function Count_Medal())
(½ Mark for loop in the function Count_Medal())
(½ Mark for checking the condition correctly in the function Count_Medal())
(½ Mark for printing the output correctly in the function Count_Medal())
Note:
● Ignore importing of CSV

SECTION-E 3x5=15

33 Logistic Technologies Ltd. is a Delhi based organization which is expanding its 5


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.

Page 17/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
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.

Distances between various blocks/locations :


HR Block to Accounts Blocks 400 meters

Accounts Block to Logistics Block 200 meters

Logistics Block to HR Block 150 meters

Delhi Head Office to Ambala Office 220 Km

Number of computers installed at various blocks are as follows :


HR Block 70

Accounts Block 40

Logistics Block 30

(i) Suggest the most appropriate block/location to house the SERVER in the
Ambala office. Justify your answer.

Ans HR Block as it has maximum number of computers


OR
Any other block/location with valid justification

(½ Mark for the correct answer)


(½ Mark for the valid justification)

(ii) Suggest the best wired medium to efficiently connect various blocks within the
Ambala office compound.

Ans Optical Fiber

(1 Mark for the correct answer)

(iii) Draw an ideal cable layout (Block to Block) for connecting these blocks for
wired connectivity.

Ans

Page 18/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
OR
Any other cable layout with valid justification

(Full 1 Mark for drawing any valid cable layout)

(iv) The company wants to schedule an online conference between the managers of
Delhi and Ambala offices. Which protocol will be used for effective voice
communication over the Internet ?

Ans VoIP

OR
Any valid protocol used for voice communication

(1 Mark for the correct answer)

(v) Which kind of network will it be between Delhi office and Ambala office ?

Ans WAN

(1 Mark for the correct answer)

34 (a) (i) What is the main purpose of seek() and tell() method ? 5

Ans seek() - it is a Python method, which moves the file pointer to the location
specified in the parameter.

tell() - it is a Python method, which returns the present location of a file pointer.

(1 Mark for correct purpose of seek() method with or without syntax/example)


( 1 Mark for correct purpose of tell() method with or without syntax/example)

(ii) Consider a binary file, Cinema.dat containing information in the following


structure :
[Mno, Mname, Mtype]
Write a function, search_copy(), that reads the content from the file
Cinema.dat and copies all the details of the "Comedy" movie type to file
named movie.dat.

Ans import pickle


def search_copy():
try:
F1=open("Cinema.dat","rb")
F2=open("movie.dat","wb")
Data1=pickle.load(F1)
Data2=[]
for D in Data1:
if D[2]=="Comedy":
Data2.append(D)
pickle.dump(Data2,F2)
F1.close()
F2.close()
except:
print("File not found!")

Page 19/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4

OR

import pickle
def search_copy():
try:
F1 = open("Cinema.dat","rb")
F2 = open("movie.dat", "wb")
try:
while True:
Data1=pickle.load(F1)
if Data1[2]=="Comedy":
pickle.dump(Data1,F2)
except:
print("Done!")
F1.close()
F2.close()
except:
print("File not found!")

OR
Any other correct variation of the code

(½ Mark for opening the file Cinema.dat in correct mode)


(½ Mark for opening the file movie.dat in correct mode)
(½ Mark for reading the content of the file Cinema.dat)
(½ Mark for the correct loop)
(½ Mark for checking the condition)
(½ Mark for writing the required contents into the file movie.dat)

Note: Ignore import pickle, F1.close() and F2.close()

OR

(b) (i) Give one difference between write() and writeline() function in text 5
file.

Ans write function - writes the content of a string onto a text file object .
writelines function - writes the content of a list of strings onto a text file
object .
Example:
file.write("Hello World")
file.writelines(["Hello","World"])

(2 Mark for writing the difference between write and writelines with/without
using examples)

OR
(1 Mark for explaining uses of write function using/without using example)
(1 Mark for explaining uses of writelines function using/without using
example)

Page 20/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
Note:
As there is no function writeline, give full 2 Marks for correctly explaining
the write function only.

(ii) A Binary file, "Items.dat" has the following structure :


[Icode, Description, Price]

Where
Icode – Item code
Description – Detail of item
Price – Price of item

Write a function Add_data(), that takes Icode, Description and Price


from the user and writes the information in the binary file "Items.dat".

import pickle
def Add_data():
F=open("Items.dat","wb")
Icode=input("Icode:")
Description=input("Detail of item:")
Price=float(input("Price:")
pickle.dump([Icode,Description,Price], F)
F.close()

OR

Any other correct variation of the code

(1 Mark for opening the file items.dat in correct mode)


(1 Mark for correctly accepting the content from user)
(1 Mark for the correctly using dump command to write the content on file)

Note:
Ignore import pickle and F.close()

35 (a) (i) Define the term foreign key with respect to RDBMS. 5

Ans Foreign Key - A column/attribute in a table/relation, which acts as a Primary Key


in another table/relation is known as a Foreign Key. It acts as a cross-reference
between two tables as it references the primary key of another table, thereby
establishing a link between them to help in producing relevant results.

( 1 Mark for the correct definition with or without example)

(ii) Sangeeta wants to write a program in Python to delete the record of a


candidate “Raman” from the table named Placement in MySQL
database, Agency:
The table Placement in MySQL contains the following attributes :
● CName – String
● Dept – String
● Place – String
● Salary – integer

Page 21/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
Note the following to establish connectivity between Python and MySQL:
● Username – root
● Password – job
● Host – localhost
Help Sangeeta to write the program in Python for the above mentioned task.

Ans import pymysql as pm


# OR Option 2
import mysql.connector as pm
DB=pm.connect(host="localhost",user="root",\
password="job",database="Agency")
MyCursor=DB.cursor()
QRY="DELETE FROM PLACEMENT WHERE CNAME='Raman'"
MyCursor.execute(QRY)
DB.commit()

(½ mark for importing with any correct module/method)


(1 mark for connect() method with correct parameters)
( ½ mark for creating the cursor)
( 1 mark for the correct SQL command - ½ Mark for DELETE and ½ Mark for
WHERE)
(½ mark for correctly executing the query QRY)
(½ mark for correct use of commit)

OR

(b) (i) Give one difference between CHAR and VARCHAR datatype in MySQL. 5

CHAR has a fixed size, but VARCHAR has a variable size.


OR
CHAR data type stores data of fixed length,
whereas the VARCHAR data type stores variable format data.
OR
VARCHAR is more memory efficient than CHAR.

Ans ( 1 Mark for the any one correct difference with or without example)

(ii) Rahim wants to write a program in Python to insert the following record in the
table named Bank_Account in MySQL database, Bank :
● Accno – integer
● Cname – string
● Atype – string
● Amount – float
Note the following to establish connectivity between Python and MySQL :
● Username – admin
● Password – root
● Host – localhost
The values of fields Accno, Cname, Atype and Amount have to be accepted
from the user. Help Rahim to write the program in Python.

Page 22/23
CBSE AISSCE 2024 (Supplementary) Marking Scheme for Computer Science
(Series &RQPS/S Sub Code: 083 Q.P. Code 91/S) SET-4
Ans import pymysql as pm
# OR Option 2
import mysql.connector as pm
DB=pm.connect(host="localhost",user="admin",\
password="root", database="Bank")
MyCursor=DB.cursor()
Accno=int(input("Accno:"))
Cname=input("Cname:")
Atype=input("Atype:")
Amount=float(input("Amount:"))
QRY="INSERT INTO BANK_ACCOUNT VALUES
(%s,'%s','%s',%s)"%(Accno,Cname,Atype,Amount)
# OR Option 2
QRY="INSERT INTO BANK_ACCOUNT VALUES
({},'{}','{}',{})".format(Accno,Cname,Atype,Amount)
# OR Option 3
QRY="INSERT INTO BANK_ACCOUNT VALUES (" + str(Accno) + ",'"
+ Cname + "','" + Atype + "'," + str(Amount) + ")"
MyCursor.execute(QRY)
DB.commit()

OR
Any other correct variation of the code

( ½ mark for importing any correct module/method pymysql or any other)


( ½ mark for correct connect())
( ½ mark for correctly creating cursor())
( ½ mark for correctly taking input from the user)
( 1 mark for the correct SQL command - ½ Mark for INSERT and ½ Mark for
VALUES)
( ½ mark for correctly executing the query QRY)
(½ mark for commit())

Page 23/23

You might also like