Greetings!
Attendance check
CHAPTER
RETRIEVING DATA USING THE 1
SQL SELECT STATEMENT
Lesson 1: Listing Capabilities of SQL SELECT Statements
Lesson 2: Generating Report of Data from the Output of a Basic
Select Statement
Lesson 3: Using Arithmetic Expressions and NULL Values
Lesson 4: Implementing Column Aliases
Lesson 5: Describing Concatenation Operator, Literal Character
Strings, Alternative Quote Operator, and the Distinct Keyword
Lesson 6: Sorting and Restricting Data
Sorting and restricting data LESSON 3
TECHNICAL TERMS
• Comparison operator – used to
identify the data to select and it is
mostly found in the WHeRE clause.
• Wildcard character - used in a string
to substitute other characters.
Comparison operators are used to compare
data with one another to test a single value.
There where clause practices comparison
operators to recognize specific rows in a table.
When used with the select statement, rows can be
selectively retrieved from a table instead of all
rows being retrieved from a table.
Comparison operators
OPERATOR DEFINITION
= EQUAL TO
!= NOT EQUAL TO
<> NOT EQUAL TO
> GREATER THAN
>= GREATER THAN OR EQUAL TO
< LESS THAN
<= LESS THAN OR EQUAL TO
BETWEEN . . . AND . . . CHECKS A VALUE WITHIN A RANGE
LIKE SEARCHES A MATCH IN A STRING
IN () TESTS FOR A MATCH IN A SPECIFIED LIST OF VALUES
NOT IN () TESTS FOR A NOT MATCH IN A SPECIFIED LIST OF VALUES
IS NULL A NULL VALUE TEST
IS NOT NULL A NOT NULL VALUE TEST
1. EQUALITY
SELECT * FROM EMPLOYEES
WHERE LAST_NAME = “KING”;
2. INEQUALITY
SELECT * FROM EMPLOYEES
WHERE FIST_NAME <> “GEORGE”;
3. Greater than operator
SELECT * FROM EMPLOYEES
WHERE salary > “2500”;
4. Greater than or equal to operator
SELECT * FROM EMPLOYEES
WHERE min_salary >= “500”;
5. Less than operator
SELECT * FROM EMPLOYEES
WHERE salary < “200”;
5. Less than or equal to operator
SELECT * FROM EMPLOYEES
WHERE max_salary <= “2200”;
Sorting and restricting data LESSON 3
RUBRICKS:
Criteria Outstanding Adequate Not Adequate
(6 Pts.) (5 Pts.) (4 Pts.)
Table Creation Created all of the tables defined Created most of the tables Partially created some of the
in project requirements defined in project requirements tables defined in project
Named tables appropriately in Table name was a little unclear in requirements. Table name did not
regard to their data elements regard to its data elements correlate to its data elements
Keys and Entities Correctly choose all primary and Correctly choose most of the Incorrectly choose most of the
foreign keys respecting the primary and foreign keys primary and foreign Keys, and
naming convention respecting the naming convention somehow respected the naming
convention
Implementation Completely populated tables with Populated tables with majority of Populated tables with minimal
correct data elements reflecting data elements outlined in the data elements defined in project
the design design the design