Consider the table EXAM given below. Write SQL commands for (i) to (iv) and output for (v) to (vii).
Table : EXAM
S.No. | Name | Stipend | Subject | Average | Division |
1 | Karan | 400 | English | 68 | First |
2 | Aman | 600 | Mathematics | 72 | First |
3 | ]aved | 500 | Accounts | 67 | First |
4 | Bishakha | 200 | Informatics | 55 | Second |
5 | Sugandha | 400 | History | 35 | Third |
6 | Suparna | 550 | Geography | 45 | Third |
(i) To list the names of those students who have obtained Division as FIRST in the ascending order of NAME.
(ii) To display a report listing NAME, SUBJECT and Annual stipend received assuming that the Stipend column has monthly stipend.
(iii) To count the number of students who have either accounts or informatics as subject.
(iv) To insert a new row in the table: 6, Mohan, 500, English, 73, Second.
(v) SELECT AVG(Stipend) from EXAM where DIVISION = “THIRD”;
(vi) SELECT COUNT(DISTINCT Subject) FROM EXAM;
(vii) SELECT MlN(Average) from EXAM where Subject =”English”;
(i) SELECT NAME FROM Exam WHERE Division =”First” ORDER By Name;
(ii) SELECT NAME, SUBJECT, STIPEND * 12 FROM EXAM;
(iii) SELECT COUNT(*) FROM EXAM WHERE SUBJECT IN (‘Accounts’,’Informatics’);
(iv) INSERT INTO EXAM VALUES (6,”Mohan”‘ 500, “English”, 73, “SECOND”);
(v) 475
(vi) 6
(vii) 68