Skip to content

ASC

SELECT * FROM Employees
ORDER BY LastName ASC;
| EmployeeID | LastName | FirstName | Department |
| ---------- | -------- | --------- | ---------- |
| 4 | Adams | Amy | HR |
| 2 | Brown | Brian | Sales |
| 3 | Clark | Chris | IT |
| 1 | Davis | David | Marketing |

In the SQL code above, SELECT * FROM Employees is used to retrieve all records from the Employees table. The ORDER BY LastName ASC clause is used to sort the records in ascending order based on the LastName column. The resulting output contains all employee records, organized in an ascending order with respect to the last names.