CBSE · 083Class XII · 2023Section E2 marks

Question 34(3)

30 March 2023 · Computer Science (083)

(iii) Write the statements to : (a) Insert a new row with appropriate data. (b) Increase the capacity of all the labs by 10 students which are on 'I' Floor.

Answer

(a)

sql
INSERT INTO LAB VALUES('L006', 'PHYSICS', 'RAVI', 25, 'II');

(b)

sql
UPDATE LAB SET CAPACITY = CAPACITY + 10 WHERE FLOOR = 'I';

Explanation

(a) INSERT INTO ... VALUES adds a new tuple supplying values for every column in declared order. (b) UPDATE with a WHERE clause modifies only rows whose FLOOR is 'I', incrementing CAPACITY by 10.