Page 83 - C++
P. 83
fstream/ ifstream
(½ Mark for each correct value of In.tellg()/sizeof(P) as 500 and 73
respectively)
OR
(1 Mark for correct stream)
5 (a) Observe the following table and answer the parts(i) and(ii) accordingly (2)
Table:Product
Pno Name Qty PurchaseDate
101 Pen 102 12-12-2011
102 Pencil 201 21-02-2013
103 Eraser 90 09-08-2010
109 Sharpener 90 31-08-2012
113 Clips 900 12-12-2011
(i) Write the names of most appropriate columns, which can be considered as
candidate keys.
Ans. Candidate Key: Pno, Name
(1 Mark for writing correct Candidate Keys)
(ii) What is the degree and cardinality of the above table?
Ans. Degree:4
Cardinality:5
(½ Mark for writing correct value of degree)
(½ Mark for writing correct value of cardinality)
(b) Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (4+2)
(viii), which are based on the tables.
TRAINER
TID TNAME CITY HIREDATE SALARY
101 SUNAINA MUMBAI 1998-10-15 90000
102 ANAMIKA DELHI 1994-12-24 80000
103 DEEPTI CHANDIGARG 2001-12-21 82000
104 MEENAKSHI DELHI 2002-12-25 78000
105 RICHA MUMBAI 1996-01-12 95000
106 MANIPRABHA CHENNAI 2001-12-12 69000
19