Advertisements
Advertisements
प्रश्न
Raghav, who works as a database designer, has created a table Student as shown below:
Table: Student
| StudentID | Name | City | Marks | Admission_Date |
| 101 | Aarav Sharma | Delhi | 85 | 2022-04-01 |
| 102 | Priya Iyer | Mumbai | 78 | 2021-05-15 |
| 103 | Rohan Verma | Bangalore | 92 | 2020-06-10 |
| 104 | Simran patel | Delhi | 88 | 2022-03-20 |
| 105 | Karan yadav | Delhi | 75 | 2021-08-05 |
Write suitable SQL query for the following.
- Show the Name and City of the students, both in uppercase, sorted alphabetically by Name.
- Display the Student ID along with the name of the month in which the student was admitted to the school.
- Calculate and display the average marks obtained by students.
- Show the names of the cities and the number of students residing in the city.
कोड लेखन
Advertisements
उत्तर
-
SELECT UPPER(Name), UPPER(City) FROM Student ORDER BY Name; -
SELECT StudentID, MONTHNAME(Admission_Date) FROM Student; -
SELECT AVG(Marks)FROM Student; -
SELECT City, COUNT(*) FROM Student GROUP BY City;
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
