DROP TABLE
VENKAT_TABLE
GO
CREATE TABLE VENKAT_TABLE(ID
INT, NAME VARCHAR(100),MARKS
INT)
INSERT INTO VENKAT_TABLE VALUES (1,'VENKAT',20)
INSERT INTO VENKAT_TABLE VALUES (2,'SUBA',80)
INSERT INTO VENKAT_TABLE VALUES (3,'LAKSHMI',45)
INSERT INTO VENKAT_TABLE VALUES (4,'SANTHI',70)
SELECT ID, NAME,
CASE WHEN MARKS >50 THEN 'GOOD'
ELSE 'BAD'
END
AS RESULT
FROM VENKAT_TABLE
|