CBSE · 083Class XII · 2025Section D1 mark

Question 32a

4 March 2025 · Computer Science (083)

Suman has created a table named WORKER with a set of records to maintain the data of the construction sites, which consists of WID, WNAME, WAGE, HOURS, TYPE, and SITEID. After creating the table, she entered data in it, which is as follows:

WIDWNAMEWAGEHOURSTYPESITEID
W01Ahmed J1500200Unskilled103
W11Naveen S520100Skilled101
W02Jacob B78095Unskilled101
W15Nihal K560110SemiskilledNULL
W10Anju S1200130Skilled103

(a) Based on the data given above, answer the following questions:

(i) Write the SQL statement to display the names and wages of those workers whose wages are between 800 and 1500. (ii) Write the SQL statement to display the record of workers whose SITEID is not known (iii) Write the SQL statement to display WNAME, WAGE and HOURS of all those workers whose TYPE is 'Skilled'. (iv) Write the SQL statement to change the WAGE to 1200 of the workers where the TYPE is "Semiskilled".

Answer

(i) SELECT WNAME, WAGE FROM WORKER WHERE WAGE BETWEEN 800 AND 1500;

(ii) SELECT * FROM WORKER WHERE SITEID IS NULL;

(iii) SELECT WNAME, WAGE, HOURS FROM WORKER WHERE TYPE="Skilled";

(iv) UPDATE WORKER SET WAGE=1200 WHERE TYPE="Semiskilled";