MS-XII-CS-SET-1
MS-XII-CS-SET-1
Or
Foreign Key: Foreign Key is a non-key attribute derived from primary key of some other table.
A table can have 0 or more foreign keys.
(2 mark for correct answer)
27 DELETE is used for deleting records from a table. DROP is used to delete the entire schema of 2
any database object like table.
e.g. DELETE FROM STUDENT WHERE ROLL = 5;
DROP TABLE STUDENT;
(2 mark for correct answer)
Or
SUM() and AVG ()-which work only with numeric data
MAX(),MIN(),COUNT()-which work with numeric data and Non-Numeric Data
(2 mark for correct answer)
28 Star topology 2
In Star topology all the devices are connected to a central hub/node.
In Star topology if the central hub fails then the whole network fails.
Bus Topology
In Bus topology each device in the network is connected to a single cable which is known as
the backbone
In Bus topology the failure of the network cable will cause the whole network to fail.
(2 mark for correct answer)
Or
(i) POP3 -POST OFFICE PROTOCOL 3
URL -UNIFORM RESOURCE LOCATOR
(ii) Give one difference between XML and HTML.
HTML(Hyper Text Markup Language):
Hyper Text Markup Language (HTML) is a language which is used to design standardized Web
Pages, so that the Web contents can be read and under stood from any computer using web
browser.
Basic structure of every web page is designed using HTML. HTML uses tags to define the way
page content should be displayed by the web browser. Web pages are stored as .html or
.htm files.
Extensible Markup Language (XML): Extensible Markup Language is a markup language and
file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules
for encoding documents in a format that is both human-readable and machine-readable.
(1 mark for each correct answer)
SECTION-C (3 x 3 = 9 M)
29 def display_lines(): 3
fin = open('Poetry.txt','r')
count=0
lst=fin.readlines()
for line in lst:
l = line.strip().split()
if l[0]=='It':
count = count+1
print(count)
fin.close()
½ mark for opening file in correct mode
½ mark for readlines function
½ mark for loop
½ mark for strip and split function
½ mark for condition and increment
½ mark for display and close
Other working code is also allowed
Or
def Transfer (oldfile, newfile):
fin = open(oldfile, "r")
fout =open(newfile, "w")
while True:
text= fin.readline( )
if len(text) != 0:
if text[e] != "#":
fout.write(text)
fin.close()
fout.close()
Transfer("source.txt", "destination.txt")
(½ mark for correct function header)
(½ mark for correctly opening the file)
(½ mark for correctly reading from the file)
( ½ mark for checking condition)
(1 mark for correctly copying data from one file to another)
30 def Push_record(): # (1½ mark for correct push element) 3
for i in List:
if i[2]=="Delhi":
Record.append(i)
print(Record)
def Pop_record(): # (1½ mark for correct push element)
while True:
if len(Record)==0:
print('Empty Stack')
break
else:
print(Record.pop())
OR
N=[12, 13, 34, 56, 21, 79, 98, 22, 35, 38]
def PushElement(S,N):
S.append(N)
def PopElement(S):
if S!=[ ]:
return S.pop()
else:
return None
ST=[]
for k in N:
if k%7==0:
PushElement(ST,k)
while True:
if ST!=[ ]:
print(PopElement(ST),end=" ")
else:
break
1- Mark for Push and 2-Mark for Pop functions.
31 (i)MCODE unique values (1 mark) 3
(ii) Degree = 4 (after removing one column) (1/2 mark)
Cardinality = 7 (after 2 more record added) (1/2 mark)
iii. mysql>alter table MOBILES add GST int; (1 mark)
OR
(i) mysql>update MOBILES set GST=(PRICE*0.18) (1 mark)
(ii) mysql>insert into MOBILES values(‘M06’,’iPHONE13’,’APPLE’,110000,’2022-03-01’);
(1 mark)
(iii) mysql>delete from MOBILES where MODEL=’NARZO50’; (1 mark)
SECTION-D (4 x 4 = 16 M)
32 I. TypeError exception raised when an operation or function is applied to an object of
inappropriate type,
ii.def get_numeric_input(prompt):
while True:
try:
value = float(input(prompt))
return value
except ValueError:
print("Error: Invalid input. Please Input a valid number.")
except:
print("Some Error Ocurred")
OR
i.The raise keyword is used to manually raise an exception like exceptions are raised by
Python itself. That means, as a programmer can force an exception to occur through raise
keyword. It can also pass a custom message to your exception handling module.
ii.a = int( input("Enter value for a :"))
b = int( input("Enter value for b :"))
try:
if b == 0:
raise ZeroDivisionError # raising exception using raise keyword
print(a/b)
except ZeroDivisionError:
print("Please enter non-zero value for b.")
(or any suitable code)
(3x 1 mark for each correct part – try, except, except)