3. Parameter queries

DEFINITION

A parameter is the value that is used by the query to select the records.

On the previous page, the example given of a parameter was the last name, 'Eaton'. This would only return records of people with this particular surname.

Other similar parameters can also be used to find all of the 'male' customers, or all customers who live in 'Birmingham'.

However, parameters don't just have to be limited to finding a record which exactly matches a single criteria. They can find all of the records which lie within a certain range, for example, 'everyone born after 1990' or 'everyone who spent between £25 and £50'

Here are some further examples of types of parameters which could be used within a query:

Greater than

>500

Less than

<250

Greater or equal to

>=310

Less than or equal to

<=1000

Between

between 200 AND 600

>=200 AND <=600

 

Wildcards

The * is used as a wildcard. This means you can search for a record, even if you don't know the exact thing to write in your query.

E* will search for everything which starts with an E.

So for example, if we couldn't remember the customer's name was Eaton, but we knew it started with E, then we could have used a wild card to find the record i.e. E*. This would have also found us Ely and Essen, but it would have helped to narrow down the search.

*N will search for everything which ends with a N

This search might find customers such as, Brown, Green, Richardson.

*as*

This will search for everything which contains the consecutive letters 'as' somewhere within the field, e.g. Aston, Last, Brasier

 

challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Wildcard Query