home study engineering computer science questions and an
home / study / engineering / computer science / questions and answers / student (student id, read) student id read 3000 ...
Question: STUDENT (Student ID, Read) Student ID Read 3000 2....
STUDENT (Student ID, Read) Student ID Read 3000 2.3 3001 5.6 3002 1.3 3003 3.3 3004 2.7 3005 4.8 3006 7.8 3007 1.5 Which student has the highest read score? Write SQL Query for this in SQL MANAGEMENT SERVER 2014.
I Have submitted this qustion almost thrice,but am getting errors in query submission
Solution
In Database Student table has two columns
To get the student ID who has the highest read score you can try the below Query:
Select studentID from Student where Read=(Select MAX(Read) from Student)
The above query will give you the studentID with maximum read score.
Result of above Query
or you can give
Select * from Student where Read=(Select MAX(Read) from Student)
This query will give you the studentID with highest Read Score
Result of above Query
In above soulution we have used MAX() function of SQL server
The MAX() function returns the largest value of the selected column.
| StudentID | Read | 
| 3000 | 2.3 | 
| 3001 | 5.6 | 
| 3002 | 1.3 | 
| 3003 | 3.3 | 
| 3004 | 2.7 | 
| 3005 | 4.8 | 
| 3006 | 7.8 | 
| 3007 | 1.5 | 

