Advertisements
Advertisements
प्रश्न
Consider the following tables:
Table 1:
ATHLETE, which stores AthleteID, Name, Country. The table displays basic information of the athletes.
Table 2:
MEDALS, which stores AthleteID, Sport, and Medals. The table displays the number of medals won by each athlete in their respective sports.
Table: ATHLETE
| AthleteID | Name | COUNTRY |
| 101 | Arjun | INDIA |
| 102 | Priya | INDIA |
| 103 | Asif | UAE |
| 104 | Rozy | USA |
| 105 | David | DENMARK |
Table: MEDALS
| AthleteID | Sport | Medals |
| 101 | Swimming | 8 |
| 102 | Track | 3 |
| 103 | Gymnastics | 5 |
| 104 | Swimming | 2 |
| 105 | Track | 6 |
Write appropriate SQL queries for the following:
- Display the sports-wise total number of medals won.
- Display the names of all the Indian athletes in uppercase.
- Display the athlete name along with their corresponding sports.
लघु उत्तर
Advertisements
उत्तर
- SELECT SPORT,SUM(Medals) FROM MEDALS GROUP BY SPORT;
- SELECT UPPER(Name) FROM ATHLETE WHERE COUNTRY = 'INDIA';
- SELECT NAME, SPORT FROM ATHLETE A, MEDALS M WHERE A.AthleteID= M.AthleteID;
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
