XII-CS SET A-QP-CbeSSC-DEC 22
XII-CS SET A-QP-CbeSSC-DEC 22
Table: CONSIGNEE
CneeID CnorID CneeName CneeAddress CneeCity
MU05 ND01 Rahul Kishore 5, Park Avenue Mumbai
ND08 ND02 P Dhinga 16/J, Moore Enclave New Delhi
KO19 MU15 A P Roy 2A, Central Avenue Kolkata
MU32 ND02 S Mittal P 245, AB Colony Mumbai
ND48 MU50 B P Jain 13, Block D, A Vihar New Delhi
Give output for the following SQL queries:
(i) SELECT A.CnorName, B.CneeName
FROM Consignor A, Consignee B
WHERE A.CnorID=B.CnorID AND B.CneeCity=’Mumbai’;
(ii) SELECT CneeName, CneeAddress
FROM Consignee
WHERE CneeCity NOT IN(‘Mumbai’, ‘Kolkata’);
(iii) SELECT DISTINCT CneeCity FROM Consignee
27 Write a function Show_words( ) in python to read the content of a text file 3
‘NOTES.TXT” and display the entire content in capital letters. Example if
the file contains:
“This is a test file”
Then the function should display the output as:
THIS IS A TEST FILE
(OR)
Write a function countmy( ) in python to read the text file “DATA.TXT”
and count the number of times “my” occurs in the file.
For example if the file “DATA.TXT” contains:
“This is my website. I have displayed my preferences in the CHOICE
section”
The countmy( ) function should display the output as : “my occurs 2 times”
28 Consider the following tables WORKER and PAYLEVEL and answer the following 3
parts of this question:
Table: WORKER
ECODE NAME DESIG PLEVEL DOJ DOB
11 Radhe Shyam Supervisor P001 13-09-2004 23-08-1981
12 Chander Nath Operator P003 22-02-2010 12-07-1987
13 Fizza Operator P003 14-06-2009 14-10-1983
15 Ameen Ahmed Mechanic P002 19-12-2005 13-03-1983
18 Sanya Clerk P002 19-12-2005 09-06-1983
Table: PAYLEVEL
PLEVEL PAY ALLOWANCE
P001 26000 12000
P002 22000 10000
P003 12000 6000
Give the output for the following SQL queries:
(i) SELECT COUNT(PLEVEL), PLEVEL FROM WORKER GROUP BY PLEVEL;
(ii) SELECT MAX(DOB), MIN(DOJ) FROM WORKER;
(iii) SELECT Name, Pay FROM WORKER W, PAYLEVEL P
WHERE W.PLEVEL=P.PLEVEL AND W.CODE<13
29 Write a function stats( ) that accepts a filename and reports the file’s longest 3
line.
30 Write Addnew(Book) and Remove(Book) functions in python to add a new 3
book and remove a book from a List of books, considering them to act as
PUSH and POP operations of the data structure Stack.
(OR)
Write a function called letter_freq(my_list) that takes one parameter, a list
of strings(mylist) and returns a dictionary where the keys are the letters
from mylist and the values are the number of times that letter appears in the
mylist, e.g.,if the passed list is as:
wlist=list(“aaaaabbbbcccdde”)
then it should return a dictionary as{‘a’:5,’b’:4,’c’:3,’d’:2,’e’:1}
S.NO SECTION-D MARKS
31 Learn Together is an educational NGO. It is setting up its new campus at 5
Jabalpur for its web-based activities. The campus has four compounds as
shown in the diagram below: