Professional Documents
Culture Documents
Section – B So, Bank A/C Num and Aadhar Num are the
candidate keys for the table.
Primary key: Aadhar Num
19.
(i) (a) OFC : Optical fibre cable Alternate key: Bank A/C Num
(b) HTML : Hypertext markup language 25. [1, 67, 3]
(ii) Obtaining the IP address of a web resource/ 2
web site from the domain name is called
Domain name resolution.
OR
Section – C
(i) Bus topology 26. 4
(ii) Two advantages of bus topologies:
27.
(i) MAX (PRICE) MIN (PRICE)
• Easy to connect and install
28000 1100
• Involves a low cost and installation time
(ii) PNAME
20. Number = 250 DIGITAL CAMERA 14X
while Number<=1000: CAR GPS SYSTEM
if Number>=750: (iii) DISTINCT SUPCODE
print (Number) S01
Number=Number+100 S02
else: S03
print (Number*2)
28. def countmy( ):
Number=Number+50
f= open("DATA.TXT","r")
21. def newtuple(t1,t2): count =0
L1=list(t1) x=f.read()
L2=list(t2) word=x.split()
L3=L1 + L2 for i in word:
t3=tuple(L3) if i == "my":
OR count=count+1
def Perfect(num):
print("my cocurs",count,"times")
s=0
for a in range(1,num): OR
if num%a==0: def countblankspace():
s+=a fname = "story.txt"
if s==num: count=0
return True with open(fname, 'r') as f:
else: l=f.readline()
return False for line in l:
22. [[[1, 2, 3, 17, 5], [6, 7, 8]], 200] for word in line:
[[[1, 2, 3, 17, 5], [6, 7, 8]], 200] for char in word:
23. (i) print(L[1][1]) if char.isspace():
(ii) del Lst[3:6] count=count+1
OR print("No. of space=",count)
70 50 20
f.close()
90 40 50
90 50 40 29.
(a) Select Distinct(PLATFORM) from
moviedetails;
24. Create table Professor(PID int Primary key, Pname (b) Select Title , Rating from Moviedetails where
varchar(30) NOT NULL, Dept varchar(20) NOT
NULL, Salary float(8,1) check (salary>10000)); language IN (“English”,”Hindi”)
OR (c) Update moviedetails set Platform=”Netflix”
where title=”Uri”;
A primary key is a value that can be used to identify
a unique row in a table. While an alternate key is 30. N=[12,13,34,56,21,79,98,22,35,38]
any candidate key which is not selected to be the def PUSH(S,N):
primary key. S.aapend(N)
Example Consider table PERSON def POP(S):
Name Bank A/C Num Aadhar Num if S!=[]:
return S.pop()
Rahul 1290889909 1800991222 else:
Gopal 1909090909 1908909090 return None
ST=[]
Bhavish 1902090909 8298291282
for k in N:
Answers 3
if k%2==0: for rec in plist:
PUSH(ST,K) if rec[3]==wrd:
while True: newlist.append(rec)
if S!=[] f.close()
print(POP(ST).end="") pickle.dump(newlist,f1)
else: f1.close()
break OR
(i) Insert ()
(ii) import pickle
Section – D def Modify(ItemId):
f=open(“Inventory.dat”,”r”)
31.(i) Update mobilemaster set m_price=m_price
–m_price*0.1; Itlst=pickle.load(f)
(ii) Select m1.m_name,m1.m_company,m2.m_ newrec=[]
supplier from mobilemaster m1, mobilestock for rec in Itlst:
m2 where m1.m_id=m2.m_id; if rec[0]== ItemId:
(iii) Select m_id,m_mf_date,m_company in=input (“Enter New Item name
from mobilemaster where year(m_mf_ :”)
date)>”2015-12-31”; iq= input (“Enter New quantity
(iv) Select Max(m_qty) , min(m_qty) from :”)
mobilestock;
ro= input (“Enter Reorder :”)
32. import csv ct= input (“Enter category :”)
def transfer(Sid):
newrec.append([in,iq,ro,ct])
stklst=[]
f=open(“stock.csv”) else :
f1= open(“newstock.csv”) newrec.append(rec)
fr=csv.reader(f) f.close()
fw=csv.writer(f1) f=open(“Inventory.dat”,”w”)
for rec in fr: pickle.dump(newrec,f)
if rec[0]==Sid:
f.close()
stklst.append(rec)
csv.writerows(stklst) 35.
(i) The Group by clause is used to group records
f.close() of a table on common values of a column to
f1.close() get aggregate results.
(ii) import MySQLdb
db = MySQLdb.connect('localhost',
'EmpDetail', 'Emp@123','EmpDB')
Section – E cursor=db.cursor()
sql="""UPDATE Employee SET
Salary=Salary+5000 WHERE
33.
(i) Finance block because it has maximum city='%s'/(Delhi)"""
number of computers. try:
(ii) db.execute(sql)
Finance
db.commit()
except:
db.rollback()
db.close()
Conference Human Resource
OR
(i) cursor.fetchmany(SIZE)
(iii) Satellite link
(ii) import MySQLdb db=MySQLdb.connect
(iv) Switch ("localhost","Admin","Ad123","Sal
(v) Man (Metropolitan Area Network) as this es")
network can be carried out in a city network. cursor=db.cursor()
34.
(i) The r+ mode is used in text and csv files. The cursor.execute("DROP TABLE IF
rb+ mode is used in binary files. EXISTS SALES_Representative")
(ii) import pickle sql="""CREATE TABLE SALES
def transfer(wrd): Representative (slsrnumb integer,
newlist=[] slsrname char(25)not null,
f=open(“Hospital.dat”,”r”) slsraddr null, totcomm double,
commrate double)"""
f1=open(“newfile.dat”,”w”)
cursor.execute(sql)
plist=pickle.load(f)
db.close()
qqq