Finding Information by Sorting
You can sort a database table to arrange the records into any order you like. To sort a database into an order you must specify:
  • which field in the database you wish to use to order the records;
  • whether you want the records in ascending (going up) or descending (going down) order.
A supermarket database has a record about each product it sells. Their table is not sorted:


You change the order the records are listed in to help find out answers to questions:

Which product is the most expensive? Do the products that last longer cost more than those that don’t last very long?
You can sort the table by the ‘Price’ field so the products appear in ascending order – cheapest at the top and dearest at the bottom.



You can then easily see that the most expensive product is the cornflakes, with a price of £1.69.
You can sort the table by the ‘Sell-by Date’ field so the products appear in ascending order – earliest at the top, latest at the bottom.



You can then easily look at the top and bottom records to see that the products that last longer are usually cheaper than those that don't last as long. The answer is therefore ‘no’.

Made by Mr S Haughton