Page 9 - IP
P. 9
(e) ‘Class’ table has columns RNO and NAME.
The following statements are executed :
SET AUTOCOMMIT = 0;
INSERT INTO CLASS VALUES(5,'Rajiv');
COMMIT;
UPDATE CLASS SET NAME='Rajeev' WHERE ID=5;
SAVEPOINT A;
INSERT INTO CLASS VALUES(6,'Chris');
SAVEPOINT B;
INSERT INTO CLASS VALUES(7,'Feroze');
SELECT * FROM CLASS;
ROLLBACK TO B;
SELECT * FROM CLASS;
What will be the output of both the above given SELECT
statements ? 2
(f) Name SQL Single Row functions (for each of the following) that 2
(i) returns a number.
(ii) returns lowercase letters.
(iii) returns names of days. For example : ‘‘Monday’’, ‘‘Tuesday’’.
(iv) returns weekday number. For example : 1 for Sunday, 2 for
Monday, 3 for Tuesday.
4. (a) Identify the error in the following code : 1
switch(c)
{
case 9.0 : a= a+2;
break;
case 8.0 : a=a+3;
break;
}
90 5 P.T.O.