Вы находитесь на странице: 1из 5

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Section 2 Quiz
(Answer all questions in this section)

1.Which two statements would select salaries that are greater than or equal to 2500
Mark for Review
and less than or equal to 3500? (Choose two)
(1) Points

(Choose all correct answers)

WHERE salary >= 2500 AND salary <= 3500 (*)


WHERE salary BETWEEN 3500 AND 2500
WHERE salary BETWEEN 2500 AND 3500 (*)
WHERE salary <=2500 AND salary >= 3500

Correct

2.Which of the following are examples of comparison operators used in the


Mark for Review
WHERE clause?
(1) Points

=, >, <, <=, >=, <>


between ___ and ___
in (..,..,.. )
like
is null
All of the above (*)

Correct

3.If you write queries using the BETWEEN operator, it does not matter in what
Mark for Review
order you enter the values, i.e. BETWEEN low value AND high value will give
(1) Points
the same result as BETWEEN high value and low value. True or False?

True
False (*)

Correct.

4.Which of the following WHERE clauses would not select the number 10?
Mark for Review
(1) Points

WHERE hours BETWEEN 10 AND 20


WHERE hours IN (8,9,10)
WHERE hours <= 10
WHERE hours <>10 (*)

Correct
5.The EMPLOYEES table contains these columns:
Mark for Review
(1) Points
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
EMAIL VARCHAR2(50)

You are writing a SELECT statement to retrieve the names of employees that
have an email address.

SELECT last_name||', '||first_name "Employee Name"


FROM employees;

Which WHERE clause should you use to complete this statement?

WHERE email IS NULL;


WHERE email = NULL;
WHERE email != NULL;
WHERE email IS NOT NULL; (*)

Correct.

Page 1 of 3
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Section 2 Quiz
(Answer all questions in this section)

6. Which of the following statements will work?


Mark for Review
(1) Points

SELECT first_name ||' '||last_name NAME, department_id DEPARTMENT,


salary*12 "ANNUAL SALARY"
FROM employees
WHERE name = 'King';
SELECT first_name ||' '||last_name NAME, department_id DEPARTMENT,
salary*12 "ANNUAL SALARY"
FROM employees
WHERE last_name = 'King';

(*)
SELECT first_name ||' '||last_name NAME, department_id DEPARTMENT,
salary*12 'ANNUAL SALARY'
FROM employees
WHERE last_name = 'King';
SELECT first_name ||' '||last_name NAME, department_id DEPARTMENT,
salary*12 'ANNUAL SALARY'
FROM employees
WHERE name = 'King';

Correct
7. You need to display all the values in the EMAIL column that contains the
Mark for Review
underscore (_) character as part of that email address. The WHERE clause in
(1) Points
your SELECT statement contains the LIKE operator. What must you include in
the LIKE operator?

The ESCAPE option (\) and one or more percent signs (%) (*)
The (+) operator
The ESCAPE option (\)
A percent sign (%)

Correct.

8. Evaluate this SELECT statement:


Mark for Review
(1) Points
SELECT last_name, first_name, salary
FROM employees;

How will the heading for the FIRST_NAME column appear in the display by
default in Oracle Application Express?

The heading will display with the first character capitalized and centered.
The heading will display as uppercase and centered. (*)
The heading will display as uppercase and left justified.
The heading will display with the first character capitalized and left
justified.

Correct.

9. If the EMPLOYEES table has the following columns, and you want to write a
Mark for Review
SELECT statement to return the employee last name and department number for
(1) Points
employee number 176, which of the following SQL statements should you use?
Name Type Length
EMPLOYEE_ID NUMBER 22
FIRST_NAME VARCHAR2 20
LAST_NAME VARCHAR2 25
EMAIL VARCHAR2 25
PHONE_NUMBER VARCHAR2 20
SALARY NUMBER 22
COMMISSION_PCT NUMBER 22
MANAGER_ID NUMBER 22
DEPARTMENT_ID NUMBER 22

SELECT last_name, department_id


FROM employees
WHERE employee_id equals 176;
SELECT last_name, department_id
FROM employees
WHERE employee_id = 176;

(*)
SELECT first_name, employee_id
FROM employees
WHERE employee_id = 176;
SELECT last_name, employee_id
FROM employees
WHERE employee_id equals 176;

Correct.

10.You want to determine the orders that have been placed by customers who
Mark for Review
reside in the city of Chicago. You write this partial SELECT statement:
(1) Points
SELECT orderid, orderdate, total
FROM orders;

What should you include in your SELECT statement to achieve the desired
results?

WHERE city = 'Chicago'; (*)


AND city = Chicago;
AND city = 'Chicago';
WHERE city = Chicago;

Correct.

Page 2 of 3
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Section 2 Quiz
(Answer all questions in this section)

11.The concatenation operator ...


Mark for Review
(1) Points

Brings together columns or character strings into other columns


Creates a resultant column that is a character expression
Is represented by two vertical bars ( || )
All of the above (*)

Correct

12.Which comparison condition would you use to select rows that match a
Mark for Review
character pattern?
(1) Points

ALMOST
IN
LIKE (*)
SIMILAR
Correct.

13.What does the DISTINCT keyword do when it is used in a SELECT clause?


Mark for Review
(1) Points

Eliminates all unique values and compares values


Eliminates duplicate rows in the result (*)
Eliminates only unique rows in the result
Hides NULL values

Correct.

14.When using the LIKE condition to search for _ symbols, which character can
Mark for Review
you use as the default ESCAPE option?
(1) Points

%
^
\ (*)
&

Correct.

15.You need to display employees whose salary is in the range of 10000 through
Mark for Review
25000 for employees in department 50 . What does the WHERE clause look
(1) Points
like?

WHERE department_id = 50
AND salary BETWEEN 10000 AND 25000
(*)
WHERE department_id > 50
AND salary BETWEEN 10000 AND 25000
WHERE department_id = 50
AND salary BETWEEN 25001 AND 10001
WHERE department_id < 50
AND salary BETWEEN 10000 AND 25000

Correct.

Page 3 of 3
 

Вам также может понравиться