0% found this document useful (0 votes)
401 views8 pages

Database Programming With SQL 2-3: Comparison Operators Practice Activities

sql oracle

Uploaded by

Minul Mirdha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
401 views8 pages

Database Programming With SQL 2-3: Comparison Operators Practice Activities

sql oracle

Uploaded by

Minul Mirdha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

academy.oracle.

com

Database Programming with SQL


2-3: Comparison Operators
Practice Activities
Objectives
• Apply the proper comparison operator to return a desired result

• Demonstrate proper use of BETWEEN, IN, and LIKE conditions to return a desired result

• Distinguish between zero and the value of NULL as unavailable, unassigned, unknown, or in
applicable

• Explain the use of comparison conditions and NULL

Vocabulary
Identify the vocabulary word for each definition below.
ESCAPE This option identifies that the escape characters should be
interpreted literally

IS NULL Condition tests for null values

BETWEEN Displays rows based on a range of values

inclusive Including the specified limits and the area between them; the
numbers 1-10, inclusive

LIKE Selects rows that match a character pattern

IN Tests for values in a specified list of values

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.

2
Try It / Solve It

1. Display the first name, last name, and salary of all Global Fast Foods staff whose salary is
between $5.00 and $10.00 per hour.

2. Display the location type and comments for all DJs on Demand venues that are Private
Home.
3. Using only the less than, equal, or greater than operators, rewrite the following query:

SELECT first_name, last_name


FROM f_staffs
WHERE salary BETWEEN 20.00 and 60.00;
4. Create a list of all the DJs on Demand CD titles that have “a” as the second letter in the
title.
5. Who are the partners of DJs on Demand who do not get an authorized expense amount?
Jennier Cho and Jason Tsang

6. Select all the Oracle database employees whose last names end with “s”. Change the
heading of the column to read Possible Candidates.
7. Which statement(s) are valid?
a. WHERE quantity <> NULL;

b. WHERE quantity = NULL;


c. WHERE quantity IS NULL;
d. WHERE quantity != NULL;

8. Write a SQL statement that lists the songs in the DJs on Demand inventory that are type
code 77, 12, or 1.
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.

You might also like