0% found this document useful (0 votes)
5 views5 pages

1st Paper Solution

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

1st Paper Solution

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

1st PAPER MARKING SCHEME

CLASS-XII SUBJECT: COMPUTER SCIENCE


TIME: 3 HOURS M.M.: 70
Section-A
1 Comma Separated Values 1
2 if 1
3 5Total 1
4 51 1
5 uteruter 1
6 csv 1
7 UPDATE 1
8 SELECT 1
9 Statement-3 1
10 NOT NULL 1
11 file_object.read() 1
12 SHOW DATABASES; 1
13 SMTP 1
14 159 1
15 MAX 1
16 connect() 1
17 Both A and R are true and R is the correct explanation for A 1
18 (d) 1
Section-B
19 def execmain(): 2
x= input("Enter a number:")
if(abs(x) == x):
print("You entered a positive number")
else:
x *= -1
print("Number made positive:" , x)
execmain()
20 1 mark for each difference 2
OR
1 mark for HTML and 1 mark for HTTP
21 (a) .m mIlH 1
(b) 400 420 1
22 DDL- Data definition language. Consists of commands used to modify the 1
schema/metadata of a table. For Example- create table, alter table, drop
table.
DML-Data manipulation language. Consist of commands used to modify the 1
data of a table. For Example- insert, delete, update
23 a. URL: Uniform Resource Locator, FTP: File Transfer Protocol 1
b. HTTP protocol is used to transmit hypermedia documents like HTML over 1
the internet
24 2 4 2
6 4
OR
2,2,0,1,2,
25 mysql.connector 1
Cursor object is used to interact with MySQL connection object from Python 1
code
OR
A unique set of attributes of a table used to identify the records uniquely. 1
1 mark for any valid example 1
26 a. Combine the rows from the table for NATURAL JOIN based on the 1
common column TID
b. 0.5
i. Mumbai, Chandigarh mark
ii. 101 2 20000 for each
iii. MEENAKSHI DDTP
iv. 2 Mumbai
2 Delhi
1 Chandigarh
1 Chennai
27 def COUNTLINES_ET(): 3
fobj = open("REPORT.txt")
lines = fobj.readlines()
lineE=0
lineT=0
for i in lines:
if i[0]=="E":
lineE+=1
elif i[0]=="T":
lineT+=1
print("No. of lines with E: ", lineE)
print("No. of lines with T: ", lineT)
COUNTLINES_ET()
OR
def SHOW_TODO():
fobj = open("ABC.txt")
for i in fobj:
if "TO" in i or "DO" in
i: print(i)
SHOW_TODO()
28 i 0.5 for
Department Count(*) each
History 3 output
Computer Sc 2
Mathematics 3
ii Max – 31/07/2018 or 2018-07-31 Min-05/09/2007 or 2007-09-05
iii
Name Department Place
Jugal Computer Sc Delhi
Shiv Om Computer Sc Delhi

iv
Gender Count(Gender)
M 5
F 3

b. DESC Teacher; 1
29 def oddeve(myList): 3
print("All positive numbers of the list :
") for ele in myList:
if ele >= 0:
print(ele, end = " ")
30 def AddCustomer(Customer): 3
CStake.append(Customer)
if len(CStack)==0:
print (“Empty Stack”)
else:
print (CStack)
OR
def DeleteCustomer():
if (CStack ==[]):
print(“Stack empty!”)
else:
print(“Record deleted:”,CStack.pop())
Section-D
31 (i) Admin Block. Because of Maximum Computers. 5
(ii) Any Suitable layout
(iii) Switch
(iv) Ethernet cable
(v) LAN
32 a. cCICKEe 2
b. 3
i. import mysql.connector
ii. cursorobj.execute(query)
iii. mysql.connector.connect(host= “192.168.11.111”, user = “root”, passwd
= “Admin”, database= “MYPROJECT”)
OR
a. G*L*TME 2
b. Statement-1: mysql.connector 1
Statement-2: cursor() 1
Statement-3: execute 1
33 Pickle module helps us to work with Binary files from Python program. 2+3

import csv
f1=open('one.csv','w',newline= “”)
w1=csv.writer(f1,delimiter = ",")
w1.writerow(['Roll.No', 'Name',
'Marks']) while True:
print ("Enter 1 to continue adding, 0 to exit")
op = int(input("Enter Option"))
if (op == 1):
rollno = int(input("Enter Roll No"))
name = input("Enter Name")
marks = int(input("Enter Marks"))
wlist = [rollno,name,marks]
w1.writerow(wlist)
elif op == 0:
break;
f1.close()
OR
tell(): It returns the current position of cursor in file
seek(): Changes the cursor position by bytes as specified by the offset.

import csv
f=open("student.csv","r")
d=csv.reader(f)
next(f)
print("Students Scored More than 80")
print()
for i in d:
if int(i[2])>80:
print("Roll Number =", i[0])
print("Name =", i[1])
print("Marks=", i[2])
f.close( )
34 a. Degree: 4 Cardinality: 6 1
b. TID as this is different for every row/tuple in the 1
table c. 2
i. INSERT INTO TRAINER (TID, TNAME, CITY, HIREDATE,
SALARY) VALUES(107,’Bhoomi’,’Delhi’,”2001-12-15”,90000);
ii. UPDATE TRAINER SET SALARY = SALARY*101 WHERE
SALARY > 80000;

OR
i. DELETE FROM TRAINER WHERE TNAME = “Richa”;
ii. ALTER TABLE TRAINER ADD Remarks VARCHAR(50);
35 i. csv 1
ii. read mode 1
iii. Line-2: “emp.csv”, “r” 2
Line-3: reader

You might also like