In order to extract the first X records of any query we can make use of the LIMIT clause. It is the last clause that gets executed in the SQL order of execution. An example of usage is –  SELECT *
FROM employees
ORDER BY employee_id DESC
LIMIT 5; The query will return the first 5 records from the employee's table when the records are ordered in descending order of their employee IDs.