Mose name starts with 'A'.
for the following on the basis of given table SPORTS :
Table : SPORTS
te SQL commands for the fo
PL. Write SOLO
Class
StudentNo.
Grade1
A
10
Game2
Swimming
Gradea
co
Skating
.
Name
Sammer
Sujit
Kamal
Venna
Archana
Arpit
Game1
Cricket
Tennis
Swimming
Tennis
Basketball
Cricket
.
Football
Tennis
Cricket
Athletics
II a
a
10
A
(1) Display the names of the stu
the names of the students who have grade 'C' in either Gamel or Game2 or both
mes of the students who have same game for both Gamel and Game2.
can Display the games taken up by the students, whose name starts with 'A'
Answers
Detailed Question:
Table - Sports
StuNo Class Name Game1 Grade1 Game2 Grade2
-------------------------------------------------------------------------------------------------------------
10 7 Sammer Cricket B Swimming A
11 8 Sujit Tennis A Skating C
12 7 Kamal Swimming B Football B
13 7 Venna Tennis C Tennis A
14 9 Archana Basketball A Cricket A
15 10 Arpit Cricket A Athletics C
To find:
- Display the names of the students who have grade C in either Game1 or Game2 or both.
- Display the names of students who have the same game for both Game1 and Game2.
- Display the games taken by the students whose name starts with A.
Solutions:
1. Display the names of the students who have grade A in either Game1 or Game2 or both
Query:
SELECT Name FROM Sports
WHERE Grade1='C' OR Grade2='C' OR (Grade1='C' AND Grade2='C');
Output:
Name
-----------------
Sujit
Venna
Arpit
2. Display the names of students who have the same game for both Game1 and Game2.
Query:
SELECT Name FROM Sports
WHERE Game1=Game2;
Output:
Name
-----------------
Venna
3. Display the games taken by the students whose name starts with A.
Query:
SELECT Game1, Game2 FROM Sports
WHERE Name LIKE 'A%';
Output:
Game1 Game2
-------------------------------------------
Basketball Cricket
Cricket Athletics
Learn more:
1. What are the maximum and the minimum number of rows returned by the R1 right outer join R2?
brainly.in/question/21195376
2. Write SQL commands for (a) to (e) on the basis of FAMILY relation given below...
https://brainly.in/question/15115256