Advertisements
Advertisements
प्रश्न
Consider the following tables:
Table 1: STUDENT, which stores StudentID, Name, and Class.
| StudentID | Name | Class |
| 1 | Ankit | 12 |
| 2 | Priya | 11 |
| 3 | Rohan | 12 |
| 4 | Shreya | 11 |
| 5 | Rehan | 12 |
Table 2: MARKS, which stores StudentID, Subject, and Score
| StudentID | Subject | Score |
| 1 | Mathematics | 85 |
| 2 | Physics | 78 |
| 3 | Chemistry | 88 |
| 4 | Biology | 81 |
| 6 | Computer Science | 93 |
Write appropriate SQL queries for the following:
- List the names of students enrolled in Class 12, sorted in ascending order.
- Display name of all subjects in uppercase where students scored more than 80 marks.
- Display the names of students along with their subject and Score.
कोड लेखन
Advertisements
उत्तर
-
SELECT Name FROM STUDENT WHERE Class = 12 ORDER BY Name ASC; -
SELECT UPPER(Subject) FROM MARKS WHERE Score > 80; -
SELECT Name, Subject, Score FROM STUDENT JOIN MARKS ON STUDENT.StudentD = MARKS.StudentID;
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
