0% found this document useful (0 votes)
141 views4 pages

Quiz DP 2

1. The document contains a 15 question quiz on SQL concepts related to SELECT statements, the WHERE clause, comparison operators, and formatting query results. 2. Key topics covered include using comparison operators like BETWEEN and > in the WHERE clause, proper formatting of date values, using wildcards like % and _ with LIKE, and default formatting of column headings in query results. 3. Questions require identifying valid SQL syntax, proper use of operators, and true statements about data types.

Uploaded by

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

Quiz DP 2

1. The document contains a 15 question quiz on SQL concepts related to SELECT statements, the WHERE clause, comparison operators, and formatting query results. 2. Key topics covered include using comparison operators like BETWEEN and > in the WHERE clause, proper formatting of date values, using wildcards like % and _ with LIKE, and default formatting of column headings in query results. 3. Questions require identifying valid SQL syntax, proper use of operators, and true statements about data types.

Uploaded by

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

Section 2 Quiz

(Answer all questions in this section)


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

True

False (*)

Incorrect. See Section 2 Lesson 3.

2. Which two statements would select salaries that are greater than or equal to 2500 and
less than or equal to 3500? (Choose two) Mark for Review
(1) Points
(Choose all correct answers)
WHERE salary BETWEEN 2500 AND 3500 (*)

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

WHERE salary <=2500 AND salary >= 3500

WHERE salary BETWEEN 3500 AND 2500

Correct

3. 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 <>10 (*)

WHERE hours IN (8,9,10)

WHERE hours <= 10

Correct

4. Which of the following are examples of comparison operators used in the WHERE
clause? Mark for Review
(1) Points
=, >, <, <=, >=, <>

between ___ and ___

in (..,..,.. )

like

is null

All of the above (*)

Incorrect. See Section 2 Lesson 3.

5. The EMPLOYEES table includes these columns:


Mark for Review
EMPLOYEE_ID NUMBER(4) NOT NULL (1) Points
LAST_NAME VARCHAR2(15) NOT NULL
FIRST_NAME VARCHAR2(10) NOT NULL
HIRE_DATE DATE NOT NULL

You want to produce a report that provides the last names, first names, and hire dates
of those employees who were hired between March 1, 2000, and August 30, 2000.
Which statements can you issue to accomplish this task?
SELECT last_name, first_name, hire_date
FROM employees
WHERE hire_date BETWEEN '01-Mar-2000' AND '30-Aug-2000';

(*)
SELECT last_name, first_name, hire_date
FROM employees
GROUP BY hire_date >= '01-Mar-2000' and hire_date <= '30- Aug-2000';
SELECT last_name, first_name, hire_date
FROM employees
WHERE hire_date BETWEEN '30-Aug-2000' AND '01-Mar-2000';
SELECT last_name, first_name, hire_date
FROM employees
AND hire_date >= '01-Mar-2000' and hire_date <= '30-Aug-2000';
Correct.

Section 2 Quiz
(Answer all questions in this section)
6. Where in a SQL statement can you not use arithmetic operators?
Mark for Review
(1) Points
WHERE

SELECT

FROM (*)

NONE

Correct.

7. You need to display employees whose salary is in the range of 10000 through 25000
for employees in department 50 . What does the WHERE clause look like? Mark for Review
(1) Points
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
WHERE department_id < 50
AND salary BETWEEN 10000 AND 25000
Correct.

8. Which of the following elements cannot be included in a WHERE clause?


Mark for Review
(1) Points
A comparison condition

A constant

A column alias (*)

A column name

Correct.

9. The structure of the table can be displayed with the _________ command:
Mark for Review
(1) Points
Dis

Desc

Desc and the Describe (*)

Describe

Correct

10. You need to display employees with salaries that are at least 30000 or higher. Which
comparison operator should you use? Mark for Review
(1) Points
"=>"

>

!=

>= (*)

Correct.

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

What should you include in your SELECT statement to achieve the desired results?
AND city = 'Chicago';

AND city = Chicago;

WHERE city = Chicago;

WHERE city = 'Chicago'; (*)

Correct.

12. You need to display all the employees whose last names (of any length) start with the
letters 'Sm' . Which WHERE clause should you use? Mark for Review
(1) Points
WHERE last_name LIKE 'Sm%' (*)

WHERE last_name LIKE 'Sm_'

WHERE last_name LIKE '_Sm'

WHERE last_name LIKE '%Sm'

Correct.

13. Evaluate this SELECT statement:


Mark for Review
SELECT last_name, first_name, salary (1) Points
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 left justified.

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 centered.

Incorrect. See Section 2 Lesson 2.

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

The ESCAPE option (\) and one or more percent signs (%) (*)

The (+) operator

A percent sign (%)

The ESCAPE option (\)

Incorrect. See Section 2 Lesson 2.

15. Which of the following are true? (Choose Two)


Mark for Review
(1) Points
(Choose all correct answers)
Character values are not case-sensitive

Character strings are enclosed in double quotation marks

Date values are format-sensitive (*)

Date values are enclosed in single quotation marks (*)

Correct

You might also like