SQL Ii
SQL Ii
• The BETWEEN operator selects values within a given range. The values can
be numbers, text, or dates.
• •The BETWEEN operator is inclusive: begin and end values are included.
• •It is a comparison operator
• •Example: Find the names of all instructors with salary between $90,000
and $100,000 (that is, ≥$90,000 and ≤ $100,000)
• •select name from instructor where salary between 90000 and 100000
Null Values
• It is possible for tuples to have a null value, denoted by null, for some of
their attributes
• null signifies an unknown value or that a value does not exist or signifies
'no value'.
• is null can be used to check for null values.
• Is not null can be used to check for not null values.
• Example: Find all instructors whose salary is null.
select name
from instructor
where salary is null
Aggregate Functions
avg_salary
avg_salary
Aggregation (Cont.)