0% found this document useful (0 votes)
61 views

Question Paper Computer Science Class 12

This document contains a summary of key differences between the percentage (%) and underscore (_) wildcard characters used in SQL LIKE operator expressions. The percentage symbol (%) matches any sequence of characters including an empty sequence, and is used to match strings starting with a given letter. The underscore (_) matches a single character and is used to match strings of a given length where specific positions can be any single character.

Uploaded by

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

Question Paper Computer Science Class 12

This document contains a summary of key differences between the percentage (%) and underscore (_) wildcard characters used in SQL LIKE operator expressions. The percentage symbol (%) matches any sequence of characters including an empty sequence, and is used to match strings starting with a given letter. The underscore (_) matches a single character and is used to match strings of a given length where specific positions can be any single character.

Uploaded by

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

Function: Initiates requests to web servers, and receives and displays content

CBSE Additional Practice Question Paper for users.


Class: XII Session: 2023-24 Web server
Computer Science (083) Purpose: Delivers web content to clients.
Marking Scheme Function: Listens to incoming requests, processes them, and sends requested
content to the client.

Q No. Answer Total Name of Web browsers: Google Chrome, Mozilla Firefox
Marks
1 mark for any one correct difference and 1/2 mark for each two correct
1 a. per%marks 1 examples
2 b. list.append(element) 1 20 num1, num2 = 10, 45 2
while num1 % num2 == 0:
3 b. lcomme T 1 num1+= 20
4 b. One block of except statement cannot handle multiple exceptions 1 num2+= 30
else:
5 c. Statement 3 1 print('hello')

6 d. dump 1 ½ mark for while


7 d. dict_student.update(dict_marks) 1 ½ mark for :
½ mark for correct indentation (inside the block of while)
8 b. mean() 1 ½ mark for else
9 c. 13.5 1 21 def dispBook(BOOKS): 2
10 PPP – Point to Point Protocol 1 for key in BOOKS:
if BOOKS[key][0] not in "AEIOUaeiou":
VoIP - Voice Over Internet Protocol print(BOOKS[key].upper())
11 b. LIKE operator 1
BOOKS = {1:"Python",2:"Internet Fundamentals ",3:"Networking
12 d. fetchone 1 ",4:"Oracle sets",5:"Understanding HTML"}
dispBook(BOOKS)
13 b. r 1
14 a. file_object.seek(offset [, reference_point]) 1 ½ mark for for loop
1 mark for if condition
15 d. Interlinking of collection of webpages is called Internet. 1 ½ mark for display in upper case
16 c. TelNet 1 OR
def FindWord(STRING,SEARCH):
17 a. Both A and R are true and R is the correct explanation for A 1 return (STRING . count (SEARCH) )
18 c. A is True but R is False 1 str = input('Enter String : ')
19 Advantages: 2 word = input('Enter word to search : ')
print('The word', word, 'occurs', FindWord(str,word), 'times')
1) A dedicated communication channel increases the quality of
communication.
½ mark for input
2) Suitable for long continuous communication.
½ mark for print statement
1 mark for counting the word and returning the value
Disadvantages:
1) Resources are not utilized fully. 22 9$14$19$5$ 2
2) The time required to establish the physical link between the two stations is
too long. ½ mark for 9$
½ mark for 14$
½ mark for each advantage and disadvantage ½ mark for 19$
½ mark for 5$
OR
23 i. del D['Mumbai'] 2
1 mark for correct answer
Web browser
Purpose: Receives and displays web content.
1 2
ii. print(S.split()) (b)
1 mark for correct answer (i)
OR NAME PROJECT
my_str = "Computer Science" Satyansh P04
alternate_chars = my_str[::2] Ranjan P01
Muneera P01
print(alternate_chars)
Alex P02
Akhtar P04
1.5 mark for logic of alternate characters ½ mark for correct output
½ mark for printing alternate characters
24 % (Percentage): 2 (ii)
 Matches any sequence of characters (including empty sequence). NAME SALARY
Akhtar 125000
 Example: LIKE 'T%' matches all those strings starting with the letter 'T'. Alex 75000
The string with just 1 character 'T' will also be considered.
½ mark for correct output
_ (Underscore):
 Matches a single character. (iii)
 Example: LIKE '_ _T' on the other hand will search for a three letter NAME DOJ
string, whose 3rd letter is 'T'. At first two places any two character can Ranjan 2015-01-21
appear. Akhtar 2015-02-01
Muneera 2018-08-19
1 mark for one correct difference. 1/2 mark each for correct example of each. ½ mark for correct output
OR
(iv)
DROP is a DDL command in SQL and can be used to remove tables (or Eid Name DOB DOJ Salary Project
database). E01 Rannja 1990-07-12 2015-01-21 150000 P01
E03 Muneera 1996-11-15 2018-08-19 135000 P01
Example: 'DROP TABLE STUDENT;' will remove the table STUDENT from
the database. ½ mark for correct output
27 (a) 3
DELETE is a DML command used to remove or delete rows/records from a (i)
table. FID MIN(FEES) MAX(FEES)
Example: 'DELETE FROM STUDENT WHERE PER < 33;' will remove all F01 12000 40000
those records from the table STUDENT where the percentage is less than 33. F04 15000 17000
F03 8000 8000
F05 NULL NULL
1 mark for one correct difference. 1/2 mark each for correct example of each.
½ mark for correct answer
25  COUNT(*) returns the count of all rows in the table, whereas COUNT() 2
is used with Column_Name passed as an argument and counts the number (ii)
of non-NULL values in a column that is given as an argument. Hence the
result may differ. AVG(SALARY)
 The SQL command with COUNT(*) may have higher value as it count 29500
all rows in the table. ½ mark for correct answer

1 mark for suitable reason (iii)


1 mark for mentioning correct command FNAME CNAME
Neha Python
26 (a) 3 Neha Computer Network
½ mark for correct answer
CODE BNAME TYPE MNO MNAME ISSUEDATE (iv)
L102 Easy Python Programming M101 SNEH SINHA 2022-10-13
F102 Untold Story Fiction M103 SARTHAK 2021-02-23 FNAME CNAME FEES
C101 Juman Ji Thriller M102 SARA KHAN 2022-06-12 Anishma Grid Computing 40000
Neha Python 17000
1 mark for correct answer ½ mark for correct answer

3 4
(b) Stu_Stk=[]
DESC or DESCRIBE command
1 mark for correct answer def Push_elements(Stu_Stk, Stu_dict):
for Stu_ID, marks in Stu_dict.items():
28 def Count(): 3 if marks[2]>=80:
F=open('Gratitude.txt') Stu_Stk.append(Stu_ID)
T=F.readlines()
X=1 def Pop_elements(Stu_Stk):
for i in T: while len(Stu_Stk)>0:
print('Line',X,':',i.count('e')) print(Stu_Stk.pop())
X=X+1 if not Stu_Stk:
F.close() print('Stack Empty')
Count()
Push_elements(Stu_Stk, Stu_dict)
½ mark for function header Pop_elements(Stu_Stk)
½ mark for opening and closing the file
½ mark for reading lines 1.5 marks for correct implementation of Push_elements()
½ mark for loop 1.5 marks for correct implementation of Pop_elements()
½ mark for count function/or any other alternate correct statement(s) 31 import csv 4
½ mark for counter def maxsalary():
f=open('record.csv', 'r')
OR reader=csv.reader(f)
skip_header = True
max= 0
def Start_with_I():
for row in reader:
F=open('Gratitude.txt')
if skip_header:
T=F.readlines()
skip_header = False
for i in T:
else:
if i[0] in 'Ii':
if(int(row[3])>max):
print(i,end='')
max=int(row[3])
F.close()
rec=row
Start_with_I()
print('Row with the highest salary : ', rec)
f.close()
½ mark for function header maxsalary()
½ mark for opening and closing the file
½ mark for reading lines ½ mark for importing module
½ mark for loop ½ mark for function definition
½ mark for if condition ½ mark for opening and closing file
½ mark for print statment ½ for reader object
29 (i) Candidate Keys : ADMNO, ROLLNO 3 ½ for skipping first row (i.e. header)
1 mark for calculating maximum salary
1 mark for correctly writing both names of candidate keys. OR ½ mark for ½ mark for displaying record having maximum salary
specifying any one candidate key correctly. 32 import pickle 4
def expensiveProducts():
with open('INVENTORY.DAT', 'rb') as file:
(ii) Degree-8, Cardinality=4 expensive_count = 0
while True:
try:
½ mark for degree and ½ mark for cardinality product_data = pickle.load(file)
product_id, product_name, quantity, price = product_data
(iii) Update result set SEM2=SEM2+.03*SEM2 where SEM2 between 70 if price > 1000:
print("Product ID:", product_id)
and 100; expensive_count += 1
except EOFError:
½ mark for writing Update result set part correctly break

½ mark for writing SEM2=SEM2+.03*SEM2 where SEM2 between 70 and print("Total expensive products: ", expensive_count)
100; correctly.
expensiveProducts()
30 Stu_dict={5:(87,68,89), 10:(57,54,61), 12:(71,67,90), 3
14:(66,81,80), 18:(80,48,91)} ½ mark for function definition

5 6
½ mark for opening and closing file while True:
½ mark for correct try and except block data = pickle.load(In_file)
1.5 mark identifying and displaying details of expensive products if data[3] == 'DELHI' and data[4] == 'MUMBAI':
pickle.dump(data,out_file)
1 mark for displaying count of expensive products except:
33 i. The most appropriate location of the server inside the MUMBAI 5 In_file.close()
out_file.close()
campus is ADMIN building due to the maximum number of computers
in it. COPY_REC()
½ mark for mentioning the branch and ½ mark for proper justification
½ mark for function definion
ii. Cable Layout ½ mark for correctly opening and closing file
Star Topology (Based on Bus Topology (Based on ½ mark for correct try and except block
server location) minimum distance between 1.5 marks for writing required data in RECORD.DAT
branches)
OR
i.
Binary CSV
1. pickle module to be used 1. csv module is used
2. Data is stored in binary 2. Data is stored in tabular
format(0s and 1s) and is not fashion and comma
in human readable form using separated by default. The
any plain text editor. file can be read by any
spreadsheet software or text
editor.
1 mark for drawing any valid cable layout 3. File extension .dat/.pdf/.exe 3. File extension .csv
etc.
iii. Switch or Hub
1mark for suggesting the correct device 2 marks for mentioning two correct differences.
OR
iv. c. Video Conferencing 1 marks for mentioning only one correct differences.
1 mark for correct answer
ii.
v.
(a) WAN import pickle
(b) LAN
def findBook(price):
½ mark for mentioning WAN and ½ mark for mentioning LAN
with open('BOOK.DAT', 'rb') as file:
34 i. 5 while True:
seek() tell() try:
book_record = pickle.load(file)
Purpose Repositions the file pointer to a Returns the current for item in book_record:
specific location within a file position of the file book_price = book_record[item][2]
pointer if book_price >= price:
Syntax seek(offset [,reference point]) tell() print(item, book_record[item])
Parameters Requires specifying the offset Requires no except EOFError:
and an optional reference point parameters break

findBook(50)
2 marks for mentioning two correct differences.
OR ½ mark for function definion
1 marks for mentioning only one correct differences. ½ mark for correctly opening and closing file
ii. ½ mark for correct try and except block
import pickle
def COPY_REC():
1.5 marks for displying required records
In_file = open('FLIGHT.DAT','rb') 35 (i) 5
out_file = open('RECORD.DAT','wb')
try:
7 8
SQL constraints are used to specify rules for the data in a table. Constraints
are used to limit the type of data that can go into a table.
Constraints –
NOT NULL - Ensures that a column cannot have a NULL value
UNIQUE - Ensures that all values in a column are different
PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Uniquely
identifies each row in a table

½ mark for correct definition, ½ mark for correct example (anyone)


(ii)
a) password='tiger'
b) mycursor = con1.cursor()
c) query = 'delete from ITEM where Iname = "{}" '.format.(item_name)
d) con1.commit()

1 mark for each correct statement

OR
(i)
Candidate Key: A candidate key is a set of attributes in a relation that can
uniquely identify each tuple (row). A relation can have multiple candidate
keys, but only one of them is chosen as the primary key.
Alternate Key: An alternate key is a candidate key that is not selected as the
primary key.

1 mark for any one correct difference.

(ii)
a) import mysql.connector as mysql
b) mycursor = con1.cursor()
c) query = 'SELECT * FROM ITEM where Price > {}'.format(5000)
d) data = mycursor.fetchall()

1 mark for each correct statement

You might also like