Sie sind auf Seite 1von 2

COMP 1630

Relational Database Design and SQL

Review Questions
Week7

Answer each of the following questions labeling your answers clearly. Save your work in the
LearningHubAssignments for Week 7 – Review Questions.

1. Explain the commandsLIKE and IN.

The SQL Server LIKE is a logical operator that determines if a character string
matches a specified pattern. ... The LIKE operator is used in the WHERE clause
of the SELECT , UPDATE , and DELETE statements to filter rows based on
pattern matching.

The IN operator allows you to specify multiple values in a WHERE


clause. The IN operator is a shorthand for multiple OR conditions.

2. Rewrite the following WHERE clause using the IN special operator.


WHERE STATE = 'UT' OR STATE= 'CA' OR STATE= 'KS'

3. Rewrite the following WHERE clause without the use of the BETWEEN special operator.
WHERE EMP_HIRE_DATE BETWEEN '2019-07-01' AND '2019-07-31'

4. Rewrite the following WHERE clause without the use of the IN special operator.
WHERE PROVINCE IN ('BC', 'QC', 'PE')

5. When a complex expression has multiple operators, what is used to override the defined
precedence of the operators in an expression?

6. Rewrite the following ORDER BY clause so the first name and last name are in descending
order.
ORDER BY EMP_FIRST_NAME, EMP_LAST_NAME

1
10 Marks

Das könnte Ihnen auch gefallen