Professional Documents
Culture Documents
The AND & OR operators are used to filter records based on more than one condition.
Now we want to select only the persons with the first name equal to "Tove" AND the last name equal to "Svendson": We use the following SELECT statement:
OR Operator Example
Now we want to select only the persons with the first name equal to "Tove" OR the first name equal to "Ola": We use the following SELECT statement:
P_Id 1 2
Tizag Tizag
In this case, we've used the equality operator greater than (>) to return orders from the orders table with a date greater than '7/31/08'.
SQL Results:
Addition Subtraction Multiplication Division Modulus 19 11 60 3 3
Modulus may be the only unfamiliar term on the chart. Modulus performs division, dividing the first digit by the second digit, but instead of returning a quotient, a " remainder" value is returned instead.
Modulus Example:
USE mydatabase; SELECT (5 / 2) -- = 2.5 SELECT (5 % 2) -- = 1 is the value that will be returned