MS BBSR T2
MS BBSR T2
Section A
Q No. Answers Marks to
No be
allotted
1. A stack is a linear data structure that follows the principle of Last In First Out (LIFO). 2
This means the last element inserted inside the stack is removed first.
Stack is a linear data structure in which the elements can be added or removed only
from one end known as “Top” of the stack. The discipline of Stack is LIFO (Last In
First Out) i.e. element inserted last will be removed first.
(1 marks for correct definition and 1 marks for correct reasons)
2 (i) FTP 1
(ii) Code Division Multiple Access 1
Uniform Resource Locator
(1/2 marks for each correct full forms)
3 Domain of an attribute is the set of values from which a value may come in a column. 2
E.g. Domain of section field may be (A,B,C,D).
(1 marks for correct definition and 1 marks for example)
4 statement 1-mydb.cursor() 2
statement 2-"DROP TABLE STUDENT"
(1 marks for each correct statement)
5 a) 20-11-2017, 21-08-2010 2
b) Sony
c) 12-02-2013
17-10-2016
d) 15300
(1/2 marks for each correct output)
6 (i) Correct difference 01 Mark 1
(ii) discount 1
1500
1250
550
2500
1850
7 a.Degree-5 2
Cardinality-6
b. Primary Key is TID, It is used to ensure data in the specific column is unique. It is
a column cannot have NULL values.
OR
Candidate key: Attribute / Attribute combinations in a relation that can serve as a
primary key. Example: In EMP table: Empno, Ename
Alternate Key: A candidate key that is not the primary key is called an alternate key.
Example: in EMP table Empno Primary key then Ename will be the alternate key.
Section B
8 Product={"TV":10000, "MOBILE":4500, "PC":12500, "FURNITURE":5500} 3
stack=[]
def PRODPUSH(stack, P): # [ 1 Mark ]
for k in Product: # [1/2 Mark ]
if P[k]<6000: # [1/2 Mark ]
stack.append(k) # [1/2 Mark ]
PRODPUSH(stack, Product) # [1/2 Mark ]
print(stack)
OR
M=[2, 10,13,17,25,32,38,44, 56, 60,21, 74, 35,15]
stack=[]
def NUMPUSH(stack, P): # [ 1 Mark ]
for k in M: # [1/2 Mark ]
if k%5==0: # [1/2 Mark ]
stack.append(k) # [1/2 Mark ]
NUMPUSH(stack, M) # [1/2 Mark ]
print(stack)
9 (i) Field Data Type Actual Datatype with 2
length
PID Numeric length 11 int(11)
ProdName Variable Character length 10 varchar(10)
DateofManufacture Data type date
Price Floating 7 digits including 2 float(7,2)
decimal