Single-Level Sorting: Users select a single column and choose either 'Ascending' (lowest to highest) or 'Descending' (highest to lowest). This is the simplest method for organizing lists like alphabetically by name or chronologically by date.
Multi-Level Sorting: This technique involves defining a sequence of sort fields within a query designer or advanced filter tool. For example, a directory might be sorted first by city and then by street address to keep related locations grouped together logically.
Query By Example (QBE): This visual methodology involves using a grid where fields are selected and specific values are typed into a 'Criteria' row. It allows users to build complex searches without writing manual code by simply defining what the desired data should look like.
Wildcard Implementation: Symbols like asterisks or percent signs are placed within search terms to represent unknown characters. Placing a wildcard at the end of a string (e.g., 'App*') will find all records starting with those letters, such as 'Apple' and 'Application'.
| Feature | Sorting | Searching |
|---|---|---|
| Goal | Organize all existing records | Isolate a specific subset of records |
| Result | Same number of records, different order | Fewer records (only those matching) |
| Method | Ascending or Descending rules | Conditional logic and operators |
AND vs. OR Logic: The AND operator restricts a search by requiring all conditions to be met, resulting in fewer records. Conversely, the OR operator expands a search by returning records that meet any of the specified conditions, making it more inclusive.
Ascending vs. Descending: Ascending order moves from A to Z or 0 to 9, while Descending order reverses this flow from Z to A or 9 to 0. This choice is critical depending on whether you want to see the oldest/smallest or newest/largest items at the top of a list.
Verify Wildcard Symbols: Different database systems use different symbols for wildcards (such as '*' or '%'). Always check the specific software context or exam requirements to ensure you are using the correct character for pattern matching.
Check Sort Priority: When an exam asks for multiple sorts, ensure you identify which is the primary sort and which is the secondary. The order in which you apply these in a QBE grid or tool is vital, as the first field defined is the one that governs the overall structure.
Test Logical Outcomes: Before finalizing a search query, mentally test a few dummy records against your criteria. For an AND query, ensure you aren't being too restrictive; for an OR query, ensure you aren't accidentally including irrelevant data.
Precision in Criteria: Remember that text criteria often require exact matches unless wildcards are used. If you search for 'Manager', you will not find 'Assistant Manager' unless you use a wildcard like '*Manager'.
Confusing Sort Order with Data Loss: A common misconception is that sorting might hide data, but sorting only changes the visibility sequence. If records seem to disappear, it is likely that a search filter or query has been applied unintentionally.
Incorrect Wildcard Placement: Placing a wildcard in the wrong position can lead to unexpected results. For example, searching for 'S' will find everything ending in S, which is very different from searching for 'S', which finds everything starting with S.
Logic Errors in AND/OR: Students often use 'AND' in speech when they mean 'OR' in logic. For example, saying 'I want to find students from London AND Paris' actually requires an OR operator in a database, because one person cannot be from two cities simultaneously.