Database Query Structure for Demographics Information
Selection
Rules
A
query consists of one or more selection rules that instruct M.O.M.
to retrieve information selectively based on criteria that you
establish. To build a rule, you select or enter elements using the
List Management Module Demographic Query Builder
Screen. Each selection rule consists of three
elements:
-
A
field from the Demographic Data that you have defined.
-
A
comparison condition such as "equal to"
-
A
comparison value, which can be a field or value to which the value
of the first field is compared.
Demographic Data Fields
Any field that you create when you define your Demographic Data
screens in the List Management Module can be selected for the FIELD
NAME.
Comparison Conditions
=
EQUALS - select this condition to define a single value for the
field. For instance, if the field is numeric, such as customer's
age, you could limit the query to customers with a single specific
age.
CONTAINS - select this condition to define a value by entering a
part of the value. For instance, if the FIELD NAME is "favorite
sport" you could enter "ball" to select baseball, football,
softball, etc.
>=GREATER THAN OR EQUAL TO - select this condition to define an
upward range including the starting value. For instance, if the
field is a date field such as customer's birthday, you could define
a list consisting of all customers with a birthday of XX/XX/XX or
greater.
>GREATER THAN - select this condition to define an upward range
excluding the starting value.
<=LESS THAN OR EQUAL TO - select this condition to define a
downward range including the starting value.
<LESS THAN - select this condition to define a downward range
excluding the starting value.
<>NOT EQUAL TO - select this condition to exclude a specific
value for a field. For instance, if the field is a letter code
signifying specific hobby interests, you could exclude all
customers with an interest in model trains by defining the not
equal to value.
Comparison Values
Depending on the Demographic Data Field and Comparison Condition
that you have selected, the comparison value can be either:
-
A
field of the same data type as the first field you selected. For
instance, for the field "favorite sport" EQUALS "baseball."
-
A
value such as a number. For instance, for the field "customer's
age" >GREATER THAN "50."
Connectors - AND/OR
Selection rules can be joined with the connectors AND and OR.
Joining two or more selection rules with AND means that a customer
must meet the criteria established by "all" selection rules in
order to be included in the list. Joining selection rules with OR
means that a customer must meet the criteria for at least one of
the selection rules in order to be included in the list.
In
the Demographic Query Screen, you join rules using the APPEND
button.
Parantheses - ( )
You can use parentheses to indicate the order for evaluating
connectors in a query. The connectors within parentheses are
evaluated first, from the innermost level of parentheses outward,
and from left to right within any set of parentheses. Without
parentheses, connectors are evaluated left to right.
For example, in the following query, OR is evaluated before
AND:
Include all customers where,
("Birthday" is GREATER THAN 01/21/56)
AND ("Favorite Sport" EQUALS "Baseball"
OR "Favorite Sport" EQUALS "Football")
The result is that the list includes only those customers whose
birthdate falls after 1/21/56 who's favorite sport is either
baseball or football.
If
the parentheses were eliminated from this query, the resulting list
would be different, since the AND condition would be evaluated
first. The list would include customers whose birthdate falls after
1/21/56 and who's favorite sport is baseball along with ALL
customers whose favorite sport is football.
In the Demographic Query Screen, you apply parentheses by entering
them in the fields provided in the Add/Edit Selected Criteria
section of the screen.
|