Page 19 - IP
P. 19
CBSE AISSCE 2018 Marking Scheme for Informatics Practices
(Sub Code: 065 Paper Code 90)
SELECT Marks+5 FROM Student WHERE Marks<33;
Identify errors(if any) in the above statement. Rewrite the correct SQL statement.
Ans Error : UPDATE should be used instead of SELECT
Correct SQL statement:
UPDATE Student SET Marks= Marks+5
WHERE Marks<33;
(½ mark for only identifying the error)
Note: Full 1 mark to be allotted if only correct SQL statement is written
(c) (i) Name the Data type that should be used to store AccountCodes like “A1001” of 2
Customers.
(ii) Name two Data types that require data to be enclosed in quotes.
Ans (i) char/varchar
(ii) char/varchar/date
(i) (1 mark for mentioning any one correct data type)
(ii) (½ mark each for mentioning any two correct data types)
Note : String data type of Java should also be accepted for both (i) and (ii) parts
and 1 mark each should be awarded
(d) Given the table ‘Player’ with the following columns : 2
Table : Player
PCODE POINTS
1 50
2 NULL
3 40
Write the output of the following statements:
(i) SELECT AVG(POINTS)
FROM Player;
(ii) Select COUNT(POINTS) FROM Player;
Ans (i) AVG(POINTS)
45
(ii) COUNT(POINTS)
2
(1 mark each for each part)
(e) ‘Class’ table has columns RNO and NAME. 2
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 ?
Page 4 of 13