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

|
  1. SELECT Name FROM SPORTS
    WHERE Grade1 = 'C' OR Grade2 = 'C';
  2. SELECT Name FROM SPORTS
    WHERE Game1 = Game2;
  3. SELECT Game1, Game2
    FROM SPORTS
    WHERE Name LIKE "A%";
Table of Contents

12. Write SQL commands for the following on the basis of given table CLUB:

COACH_IDCOACHNAMEAGESPORTSDATOFAPPPAYSEX
1KUKREJA35KARATE27.3.961000M
2RAVINA34KARATE20.1.981200F
3KARAN34SQUASH19.2.982000M
4TARUN33BASKETBALL1.1.981500M
5ZUBIN36SWIMMING12.1.98750M
6KETAKI36SWIMMING24.2.98800F
7ANKITA39SQUASH20.2.982200F
8ZAREEN37KARATE22.2.981100F
9KUSH41SWIMMING13.1.98900M
10SHAILYA37BASKETBALL19.2.981700M
Table : CLUB
  1. To show all information about the swimming coaches in the club.
  2. To list names of all coaches with their date of appointment (DATOFAPP) in descending order.
  3. To display a report, showing coachname, pay, age and bonus (15% of pay) for all the coaches.
  • SELECT * FROM CLUB
    WHERE SPORTS="SWIMMING";
  • SELECT COACHNAME, DATOFAPP
    FROM CLUB
    ORDER BY DATOFAPP DESC;
  • SELECT COACHNAME, PAY, AGE, 0.15*PAY AS BONUS
    FROM CLUB;
"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 *