Page 221 - C++
P. 221
(ii) What is the degree and the cardinality of the above table? [2]
b) Consider the following tables STATIONARY and CONSUMER. Write SQL commands for the
statement (i) to (iv) and output for SQL queries (v) to (viii) :
Table : STATIONARY
S_ID StationaryName Company Price
DP01 Dot Pen ABC 10
PL02 Pencil XYZ 6
ER05 Eraser XYZ 7
PL01 Pencil CAM 5
GP02 Gel Pen ABC 15
Table : CONSUMER
C_ID ConsumerName Address S_ID
01 Good Learner Delhi PL01
06 Write Well Mumbai GP02
12 Topper Delhi DP01
15 Write and Draw
(i) To display the details of those consumers whose Address is Delhi .
(ii) To display the details of Stationary whose Price is in the range of 8 to 15 . (Both value included)
(iii)To display the ConsumerName , Address from Table Consumer , and Company and Price from
table Stationary, with their corresponding matching S_ID .
(iv) To increase the Price of all stationary by 2 .
(v) SELECT DISTINCT Address FROM CONSUMER .
(vi) SELECT Company , MAX(Price) , MIN(Price) , COUNT(*)
FROM STATIONARY GROUP BY Company ;
(vii) SELECT Consumer , ConsumerName , Stationary.StationaryName , Stationary.Price
FROM Stationary , Consumer WHERE Consumer.S_ID=Stationary.S_ID ;
(viii) Select StationaryName , Price*3 From Stationary ; [6]
Q.6 a)State and verify the De-Morgan’s Theorem (Any One) algebraically . [2]
b) Write the equivalent boolean expression for the following logic circuit :- [1]
X’
Y
X
Y’
c) Write the Sum of Product form and Product of Sum form of the function F(P,Q,R) for the
following truth table representation of F : [2]
P Q R F
0 0 0 1
0 0 1 0
5