You now have a basic idea of the most popular databases available in the market today. Very few databases have great customization features like PostgreSQL. You can even write Python codes and run them in the PostgreSQL database.


The SQL SELECT TOP command retrieves records from one or more tables in a database and allows us to limit the query result set based on the number of rows or the percentage of rows. This clause is used when the database tables contain thousands of records. In most cases, the TOP and ORDER BY constructions are used in conjunction.

Top-Rated Databases Across the Internet

Start with the basics course for PostgreSQL queries offered by LearnSQL.com. Here is a good article to guide your online learning journey. MongoDB has become quite popular in the last few years with the number of users growing at almost the same rate as PostgreSQL. For a very different kind of database application, of course. Wondering how different a MongoDB query looks from other SQL queries?

An aggregate function performs a calculation on a set of values and returns a single result. DROP DATABASE deletes the entire database including all of its tables, basis sql indexes etc as well as all the data within it. CREATE DATABASE creates a new database, assuming the user running the command has the correct admin rights.

SQL TOP and the ORDER BY clause

The OFFSET clause is mandatory, while the FETCH clause is optional. The below example would return the number of rows for each name, but only for names with more than 2 records. CREATE can be used to set up a database, table, index or view. SELECT DISTINCT only returns data that is distinct — in other words, if there are duplicate records, it will return only one copy of each. These common SQL commands and operators are a great reference.


Since you need SQL to work with databases, learning SQL is definitely among the first steps towards a career that involves data crunching or use in any way. The best way to learn SQL is the interactive online learning platform LearnSQL.com. We offer over 60 SQL courses at various levels of proficiency, starting with SQL basics, through SQL practice to advanced SQL topics. The SQL SELECT TOP statement is used to retrieve records from one or more tables in a database and limit the number of records returned based on a fixed value or percentage. The SELECT TOP statement in SQL shows the limited number of records or rows from the database table.

If a Student table contains a large quantity of data about students, the select TOP statement decides how much students’ data will be fetched from the provided database. In this tutorial, we will learn how to use SQL SELECT TOP queries and strengthen our understanding with examples. This SQL SELECT TOP example would select the first 10% of the records from the full result set. So in this example, the SELECT statement would return the top 10% of records from the contacts table where the last_name is ‘Anderson’. The following example uses PERCENT to specify the number of products returned in the result set.


Leave a reply