Sort Data in Databases (CIE IGCSE ICT)

Revision Note

Becci Peters

Expertise

Computer Science

Sorting Data in Databases

Sorting is a crucial function in databases. It helps organise and present data in a meaningful way.

Using a Single Criterion to Sort Data

  • You can sort data based on a single criterion - such as by name, date, or numerical value
  • For example, you might sort a list of students in ascending order by their last names
  • To sort the customer's tables by LastName in either ascending or descending order:
  1. Open the table in Datasheet View
  2. Click on the column header for the field to be sorted. For example, a table of customers to be sorted by LastName, click on the LastName column header
  3. Click on the "Sort Ascending" or "Sort Descending" button in the toolbar at the top of the screen

unnamed-24

Using Multiple Criteria to Sort Data

  • You can also sort data based on multiple criteria
  • For instance, you might want to sort a list of products first by category (ascending), and within each category, by price (descending)
  • To sort the customer's table first by City, and then by LastName within each city:
    1. Open the table in Datasheet View
    2. Click on the column header for the first field to be sorted. For example, sorting by City and then by LastName within each city, first, click on the City column header
    3. Click on the "Sort Ascending" or "Sort Descending" button in the toolbar
    4. Next, hold down the Shift key and click on the column header for the second field to be sorted by (LastName in this example)
    5. While still holding down the Shift key, click on the "Sort Ascending" or "Sort Descending" button again

Ascending and Descending Order

  • Ascending Order - Data is sorted from smallest to largest (e.g., from A to Z, or from 1 to 100)
  • Descending Order - Data is sorted from largest to smallest (e.g., from Z to A, or from 100 to 1)

Exam Tip

  • Remember, when sorting by multiple criteria, the data is first sorted by the first criterion. Within each group of the first criterion, it is sorted by the second criterion, and so on

You've read 0 of your 0 free revision notes

Get unlimited access

to absolutely everything:

  • Downloadable PDFs
  • Unlimited Revision Notes
  • Topic Questions
  • Past Papers
  • Model Answers
  • Videos (Maths and Science)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Becci Peters

Author: Becci Peters

Becci has been a passionate Computing teacher for over 9 years, teaching Computing across the UK helping to engage, interest and develop confidence in the subject at all levels. Working as a Head of Department and then as an educational consultant, Becci has advised schools in England, where her role was to support and coach teachers to improve Computing teaching for all. Becci is also a senior examiner for multiple exam boards covering GCSE & A-level. She has worked as a lecturer at a university, lecturing trainee teachers for Computing.