Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Ravi Kiran

CBSE CLASS XII

(c) //Function to copy records from SPORTS.DAT to
//ATHELETIC.DAT
void SP2AT()
{
fstream IS,OA;
Sports S;
IS.open(“SPORTS.DAT”,ios::binary|ios::in);
OA.open(“ATHLETIC.DAT”,ios::binary|ios::out);
while(IS.read((char*) &S,sizeof(S)))
{
if(strcmp(S.Event,”Athletics”)==0)
OA.write((char *)&S,sizeof(S));
}
IS.close();
OA.close();
}

5. (a) The Primary Key is an attribute/set of attributes that identifies a tuple/ row/ record uniquely.
Example:
Rollnumber in the table STUDENT
AccessionNumber in the table LIBRARY
EmpNumber in the table EMPLOYEE
PanNumber in the table INCOMETAX
MemberNumber in the table MEMBER
AccNumber in the table BANK
Any other suitable example

(b) (i) SELECT CnorName FROM CONSIGNOR WHERE City=’Mumbai’;

(ii) SELECT B.CneeID, A.CnorName, A.CnorAddress,
B.CneeName , B.CneeAddress
FROM Consignor A, Consignee B
WHERE A.CnorID=B.CnorID;

OR

SELECT Consigner.CneeID, CnorName, CnorAddress,
CneeName, neeAddress
FROM Consignor, Consignee
WHERE Consignor.CnorID= Consignee.CnorID;

(iii) SELECT * FROM CONSIGNEE ORDER BY CneeName;

(iv) SELECT City,Count(CnorID) FROM CONSIGNOR Group By City;

OR

SELECT City,Count(*) FROM CONSIGNOR Group By City;

(v) DISTINCT CneeCity
Mumbai
New Delhi
Kolkata

(vi) A.CnorName B.CneeName
R Singhal Rahul Kishore
Amit Kumar S Mittal

(vii) CneeName CneeAddress
P Dhingra 16/J,Moore Enclave
B P Jain 13,Block D,A Vihar

(viii) CneeID CneeName
MU05 Rahul Kishore
KO19 A P Roy

Paper By Mr. Ravi Kiran
Email Id : [email protected]