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

Revision Exam I (XII) Ans-1

Uploaded by

vanitha.vani6
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)
13 views8 pages

Revision Exam I (XII) Ans-1

Uploaded by

vanitha.vani6
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

Revision Exam I

COMPUTER SCIENCE (083)


Class: XII Maximum Marks: 70
Date: 28-11-2024 Duration: 3.00 Hrs.
Section A
1. (b) TRUE 1
2. Ptrc 1
3. a. dictionary 1
4. (c) != 1
5. a)False True 1
6. d) Both a) & b) 1
7. (b) INSERT 1
8. d) Primary Key 1
9. (c) T[3] = ‘thurs’ 1
10. (a) Alter. 1
11. c) myfile = open(‘Myfile.txt’); myfile.readline() 1
12. c)desc, asc 1
13. c)star 1
14. b)1.0 1
15. c)in 1
16. c)connect() 1
17. a) \n 1
18. b) Directs the order of Execution of statements in the program 1
19. b) MySQLdb.connect
20. a) Both A and R are true and R is the correct explanation for A
21. a) Both A and R are true and R is the correct explanation for A 1
Section B
22. STRING="WELCOME” 2
NOTE = " "
for S in range(0,8):
if STRING[S]== ’E’:
print(STRING(S))
else:
print (“NO”)

1
23. 2
Post Office Protocol version 3 is used to access mailbox and download e-mail
messages to the local computer.
OR
A modem is a computer peripheral that connects a workstation to other work
stations via telephone lines and facilitates communications.
Modem converts digital signals to A/F(Audio Frequency) tones which are in the
frequency range that the telephone lines can transmit and also it can convert
transmitted tones back to digital information

24. (a) [”Science”,10,”PRE”,30,”BOARD”] 2


(b) 15.0
25. A table may have more than one such attribute/group of attributes that identifies a 2
tuple uniquely, all such attribute(s) are known as Candidate Keys.
Table:Item

In the above table Item, ItemNo can be a candidate key


26. a) SMTP – Simple Mail Transfer Protocol 2
b) HTML – Hyper Text Markup Language
c) PAN – Personal Area Network
d) MODEM – Modulator Demodulator
27. [20, 10, 40, 30, 60, 50] 2
OR
450 # 300
450 # 150
200 # 150
28. This is because the column commission contains a NULL value and the aggregate 2
functions do not take into account NULL values. Thus Command1 returns the
total number of records in the table whereas Command2 returns the total number
of non NULL values in the column commission.
OR
DROP TABLE, CREATE TABLE
DML :Data Manipulation Command
½ mark for each correct command
1 mark for correct full form
SECTION C

2
29. OUTPUT: 1+2
a)
i)
Name Designation Salary
Rakesh Minhas Manager 45000

b)(i)

Designation Count(*)
Manager 2
Accountant 1
Clerk 2

(ii) AVG(Age)
34
(iii)
Name Designation Gender
Himani Singh Clerk F
Shreya Sharma Clerk F

(iv)
Designation
Manager
Accountant
Clerk
30. def cnt_M(): 3
num=0
f=open('MYNOTES.TXT','r')
for line in f.readlines():
if line[0]=='M':
num=num+1
print(num)
f.close()
OR
def BIGWORDS():
num=0
f=open('CODE.TXT','r')
data=f.read()
words=data.split()
for w in words:
if len(w)>=7:
num=num+1
print(num)
f.close()
Using any correct code giving the same result is also accepted

3
31. Using any correct code giving the same result is also accepted 3
def PUSH(Num):
s=[]
for x in Num:
if x%2==0 and x>0:
s.append(x)
if len(s)==0:
print("STACK EMPTY")
else:
print(s)
OR
def POP(cities):
#For empty stack
if(len(cities)==0):
print("Under flow")
else:
l=len(cities)
c=cities[l-1]
print(c)
cities.pop(l-1)
SECTION D
32. import pickle 4
def AddStudents():
F= open("STUDENT.DAT",'wb')
while True:
Rno = int(input("Rno :"))
Name = input("Name : ")
Percent = float(input("Percent :"))
L = [Rno, Name, Percent]
pickle.dump(L,F)
Choice = input("enter more (y/n): ")
if Choice in "nN":
break
F.close()
def GetStudents():
Total=0
Countrec=0
Countabove75=0
with open("STUDENT.DAT","rb") as F:
while True:
try:
R = pickle.load(F)
4
Countrec+=1
Total+=R[2]
if R[2] > 75:
print(R[1], " has percent = ",R[2])
Countabove75+=1
except:
break
if Countabove75==0:
print("There is no student who has percentage
more than 75")
average=Total/Countrec
print("average percent of class = ",average)
AddStudents()
GetStudents()

33. (i) DRINKCODE 4


(ii) Degree -6, Cardinality -8
(iii)
a) insert into SOFTDRINK values(107, ‘ Khatta Aam’, 15.00, 100);
b) update SOFTDRINK set price=price+price*0.03 where dname like ‘A%’;
OR
(iii)
a) Delete from SOFTDRINK where calories=120;
b) Alter table softdrink
add FAT decimal(5,2);

34. Difference between binary file and csv file: 4


(Any one difference may be given)
Binary file:
 Extension is .dat
 Not human readable
 Stores data in the form of 0s and 1s
CSV file
 Extension is .csv
 Human readable
 Stores data like a text file

import csv
def ADD():
fout=open("record.csv","a",newline="\n")
5
wr=csv.writer(fout)
empid=int(input("Enter Employee id :: "))
name=input("Enter name :: ")
mobile=int(input("Enter mobile number :: "))
lst=[empid,name,mobile] --------- 1/2 mark
wr.writerow(lst) --------- 1/2 mark
fout.close()
def COUNTR():
fin=open("record.csv","r",newline="\n")
data=csv.reader(fin)
d=list(data)
print(len(d))
fin.close()
ADD()
COUNTR()
OR
Advantage of a csv file:
 It is human readable – can be opened in Excel and Notepad applications
 It is just like text file
OR

import csv
def add():
fout=open("furdata.csv","a",newline='\n')
wr=csv.writer(fout)
fid=int(input("Enter Furniture Id :: "))
fname=input("Enter Furniture name :: ")
fprice=int(input("Enter price :: "))
FD=[fid,fname,fprice]
wr.writerow(FD)
fout.close()
def search():
fin=open("furdata.csv","r",newline='\n')
data=csv.reader(fin)
found=False
print("The Details are")
for i in data:
if int(i[2])>10000:
found=True
print(i[0],i[1],i[2])
if found==False:
print("Record not found")
fin.close()
add()
print("Now displaying")
search()

6
35. (i) SELECT * FROM WORKERS ORDER BY LASTNAME; 4
(ii) SELECT FIRSTNAME, W_ID, ADDRESS FROM WORKERS WHERE
GENDER=’M’;
(iii) SELECT MIN(SALARY) FROM DESIG WHERE DESIGNATION
IN(‘MANAGER’, ‘CLERKS’);
(iv) SELECT FIRSTNAME, SALARY FROM WORKERS, DESIG WHERE
WORKERS.W_ID=DESIG.W_ID;

SECTION E

36. a. Most suitable place to install the server is HR Unit 5


b.

HR

DESIGN TRAINING

c. Switch
c. Ethernet Cable
d. WAN as the given distance is more than range of LAN and MAN.
37. a) 4 5
3
b) import mysql.connector as mysql
def sql_data():
con1=mysql.connect(host="localhost",user="root",passw
ord="tiger", database="company")
mycursor=con1.cursor()
rno=int(input("Enter Employee ID :: "))
name=input("Enter name :: ")
class=int(input("Enter Department ID :: "))
marks=int(input("Enter Salary :: "))
querry="insert into employee
values({},'{}',{},{})".format(eid,name,deptid,salary)
mycursor.execute(querry)
con1.commit()
print("Data Added successfully")
7
OR
a) (space) THAAIbbbbCOM
b) import mysql.connector as mysql
def sql_data():
con1=mysql.connect(host="localhost",user="root",
password="tiger", database="school")
mycursor=con1.cursor()
print("Students where students name starts with ‘A’: ")
mycursor.execute("select * from student where name like ‘A%’")
data=mycursor.fetchall()
for i in data:
print(i)
print()

You might also like