Sorting a database arranges the records in order.
A simple sort arranges the records based on the contents of one field in the database table.
A complex sort involves the software arranging the records based on 2 or more fields. It will have a primary and a secondary sort key. The data is first sorted by the primary sort key and then§ the secondary sort key is used if two or more fields have the same value.
Once the sort keys have been identified there are 2 ways of sorting data, ascending and descending.