2 Restricting and Sorting Data
2 Restricting and Sorting Data
2 Restricting and Sorting Data
Objectives
2-2
Limiting Rows Using a Selection
EMPLOYEES
“retrieve all
employees
in department 90”
2-3
Limiting the Rows Selected
2-4
Using the WHERE Clause
2-5
Character Strings and Dates
2-6
Comparison Conditions
Operator Meaning
= Equal to
2-7
Using Comparison Conditions
2-8
Other Comparison Conditions
Operator Meaning
2-9
Using the BETWEEN Condition
2-10
Using the IN Condition
2-11
Using the LIKE Condition
SELECT first_name
FROM employees
WHERE first_name LIKE 'S%';
2-12
Using the LIKE Condition
2-13
Using the NULL Conditions
2-14
Logical Conditions
Operator Meaning
2-15
Using the AND Operator
2-16
Using the OR Operator
2-17
Using the NOT Operator
2-18
Rules of Precedence
2-19
Rules of Precedence
2-20
Rules of Precedence
2-21
ORDER BY Clause
2-22
Sorting in Descending Order
2-23
Sorting by Column Alias
2-24
Sorting by Multiple Columns
…
• You can sort by a column that is not in the
SELECT list.
2-25
Summary
2-26
Practice 2 Overview
2-27
2-28
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: