4-2 Query

Query is to retrieve the attribute data without altering the existing data according to specifications given by the operator.

The specifications include the following three items, given usually in Standard Query Language (SQL).

SELECT: attribute name (s)
FROM: table
WHERE: condition statement

The conditional statement is represented by the following three types of operator.

relational: >, <, =, ³, £
Arithmetic: +, -, x, ¸
Boolean (logical): AND, OR, NOT, XOR (exclusive OR)

The Boolean operators are used to combine more than two conditions as shown in Figure 4.2.
The Boolean operators are based on 0 and 1; 0 if the attributes do not meet the condition and 1 if they do as shown in    Figure 4.2.
The Boolean operators are based on 0 and 1; 0 if the attribute do not meet the condition and 1 if they do as shown in       Figure 4.3.

AND: multiply
OR: add (2 is reclassified to 1)
NOT: subtract (-1 is reclassified to 0)
XOR: (add)- (multiply)