大象传媒

AND/OR/NOT queries

such as Microsoft Access use language to narrow down search results. A query can look at more than one field.

Reg. numberMakeModelDate registeredPriceTaxed
R623 PHMFordFiesta0101986800Y
P887 LHWRover2000103977500Y
X842 PLDFordMondeo0101968100N
P812 WHJPeugeot4060109967000N
T419 PCPCitroenC40109996000Y
Reg. numberR623 PHM
MakeFord
ModelFiesta
Date registered010198
Price6800
TaxedY
Reg. numberP887 LHW
MakeRover
Model200
Date registered010397
Price7500
TaxedY
Reg. numberX842 PLD
MakeFord
ModelMondeo
Date registered010196
Price8100
TaxedN
Reg. numberP812 WHJ
MakePeugeot
Model406
Date registered010996
Price7000
TaxedN
Reg. numberT419 PCP
MakeCitroen
ModelC4
Date registered010999
Price6000
TaxedY

This is a list of common terms used in query language with example usage based on the table:

  1. AND - use to find all records where the make is a Ford AND the price is less than 8000. This would return the Fiesta but not the Mondeo.
  2. OR - use to find all records where the make is a Ford OR Rover. This would only return the Ford Fiesta, the Ford Mondeo and the Rover 200.
  3. NOT - use to find all records where the make is NOT Citroen. This would return all records except the Citroen C4.

In query language, these examples would look similar to this:

  1. [Make] = "Ford" AND [Price] < 8000
  2. [Make] = "Ford" OR [Make] = "Rover"
  3. [Make] = NOT "Citroen"
Demonstration of and or not query process using sieves to filter car results