---
title: "How to get names and marks of the top three students."  
description: "How to get names and marks of the top three students."  
author: "Ravi Vishwakarma"  
published: 2021-09-22  
updated: 2021-09-22  
canonical: https://www.mindstick.com/forum/156750/how-to-get-names-and-marks-of-the-top-three-students  
category: "database"  
tags: ["database", "mysql", "sql server", "sql"]  
reading_time: 2 minutes  

---

# How to get names and marks of the top three students.

Suppose a [Student table](https://www.mindstick.com/forum/157561/what-is-the-stored-procedure-create-a-procedure-to-find-the-record-by-stu_id-from-the-student-table) has two columns, [Name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide) and Marks. How to get names and marks of the top three students.

## Replies

### Reply by Kirti Sharma

We can get name and marks of top 3 students as follows:

SELECT **TOP 3** * FROM table_name ORDER BY column_name;

### Reply by Shivani

The names and marks of the top three students are obtained using a SELECT statement. The following SQL statement is used to determine the column in a table's given records with the highest value:

SELECT TOP N * FROM table_name ORDER BY column_name DESC;

You can write the query.

SELECT TOP 3* FROM students ORDER BY marks DESC;

if you want to learn more about databases, for example, Oracle Database you can join Oracle Online Course and solve these questions easily hope you like this

### Reply by Ashutosh Kumar Verma

## SQL SELECT Highest value:

To find the highest value from given records of column in a [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) then the following SQL statement is used for it,

SELECT TOP N * FROM table_name ORDER BY column_name DESC;

And find the min value from that table then,

SELECT TOP N * FROM table_name ORDER BY column_name ;(or ASC ;)

## Example:

Lets have a database table ‘Students’ that store the record of students.

![How to get names and marks of the top three students.](https://www.mindstick.com/mindstickforums/15123849-fb6f-44d3-b576-05b35ca73ce6/images/39a76ad1-0158-4e7b-9f7c-e9a4e88234f8.png)

The following SQL statement is used to find the records of 3 students who get the highest marks.

select top 3 stuName, stuMarks from Students order by stuMarks desc;

![How to get names and marks of the top three students.](https://www.mindstick.com/mindstickforums/15123849-fb6f-44d3-b576-05b35ca73ce6/images/9f8b280f-a540-4266-9445-acb1abd5c9a1.png)\


---

Original Source: https://www.mindstick.com/forum/156750/how-to-get-names-and-marks-of-the-top-three-students

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
