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

|
Table of Contents

14. Write SQL commands for the following on the basis of given table STUDENT1:

No.NameStipendStreamAvgMarkGradeClass
1Karan400.00Medical78.5B12B
2Divakar450.00Commerce89.2A11C
3Divya300.00Commerce68.6C12C
4Arun350.00Humanities73.1B12C
5Sabina500.00Nonmedical90.6A11A
6John400.00Medical75.4B12B
7Robert250.00Humanities64.4C11A
8Rubina450.00Nonmedical88.5A12A
9Vikas500.00Nonmedical92.0A12A
10Mohan300.00Commerce67.5C12C
Table : STUDENT1
  1. Select all the Nonmedical stream students from STUDENT1.
  2. List the names of those students who are in class 12 sorted by Stipend.
  3. List all students sorted by AvgMark in descending order.
  4. Display a report listing Name, Stipend, Stream and amount of stipend received in a year assuming that the Stipend is paid every month.
  1. SELECT * FROM STUDENT1
    WHERE Stream="Nonmedical";
  2. SELECT Name
    FROM STUDENT1
    WHERE Class LIKE "12%"
    ORDER BY Stipend;
  3. SELECT * FROM STUDENT1
    ORDER BY AvgMark DESC;
  4. SELECT Name, Stipend, Stream, Stipend*12 AS 'Stipend per Year'
    FROM STUDENT1;
"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 *