[Assignments] Simple Queries in SQL — Chapter 12 Assignments (Q/A)

|
Table of Contents

18. Write SQL commands for the following on the basis of given table GRADUATE:

NONAMESTIPENDSUBJECTAVERAGERANK
1KARAN400PHYSICS681
2DIVAKAR450COMPUTER SC681
3DIVYA300CHEMISTRY622
4ARUN350PHYSICS631
5SABINA500MATHEMATICS701
6JOHN400CHEMISTRY552
7ROBERT250PHYSICS641
8RUBINA450MATHEMATICS681
9VIKAS500COMPUTER SC621
10MOHAN300MATHEMATICS572
Table : GRADUATE

(a) List the names of those students who have obtained Rank 1 sorted by NAME.
(b) Display a report listing NAME, STIPEND, SUBJECT and amount of stipend received in a year assuming that the STIPEND is paid every month.

  1. SELECT NAME FROM GRADUATE
    WHERE RANK = 1
    ORDER BY NAME ;
  2. SELECT NAME, STIPEND, SUBJECT, STIPEND*12 AS 'STIPEND PER YEAR'
    FROM GRADUATE ;
"Spread the light within, illuminate the hearts around you. Sharing is not just an action, but a sacred journey of connecting souls."~ Anonymous

Leave a Reply

Your email address will not be published. Required fields are marked *