LIVE Course for free

Rated by 1 million+ students
Get app now
+1 vote
179k views
in Computer by (78.0k points)
edited by

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";

1 Answer

+2 votes
by (76.1k points)
selected by
 
Best answer

(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

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...