Professional Documents
Culture Documents
(1) Points
SELECT TO_CHAR(hire_date, 'DDspth 'of' Month RRRR')
FROM employees;
SELECT TO_CHAR(hire_date, 'DDTH "of" Month YYYY')
FROM employees;
SELECT TO_CHAR(hire_date, 'ddth "of" Month YYYY')
FROM employees; (*)
SELECT enroll_date(hire_date, 'DDspth "of" Month YYYY')
FROM employees;
Correct
(1) Points
LENGTH, SUBSTR, LPAD, TRIM
ROUND, TRUNC, ADD_MONTHS
TO_CHAR, TO_DATE, TO_NUMBER (*)
NVL, NVL2, NULLIF
Correct
3. You have been asked to create a report that lists all customers who have
placed orders of at least $2,500. The report's date should be displayed using
this format:
Day, Date Month, Year (For example, Tuesday, 13 April, 2004 ).
Which statement should you issue?
Mark for Review
(1) Points
SELECT companyname, TO_DATE (sysdate, 'dd, dy month, yyyy'), total
FROM customers NATURAL JOIN orders
WHERE total >= 2500;
SELECT companyname, TO_CHAR (sysdate, 'fmDay, dd Month, yyyy'), total
FROM customers NATURAL JOIN orders
WHERE total >= 2500; (*)
SELECT companyname, TO_DATE (date, 'day, dd month, yyyy'), total
FROM customers NATURAL JOIN orders
WHERE total >= 2500;
SELECT companyname, TO_CHAR (sysdate, 'fmdd, dy month, yyyy'), total
FROM customers NATURAL JOIN orders
WHERE total >= 2500;
Correct
(1) Points
Single row functions can accept only one argument, but can return multiple
values.
Single row functions return one or more results per row.
Single row functions can be nested. (*)
Single row functions cannot modify a data type.
Correct
5. Which statement will return the salary (for example, the salary of 6000)
from the Employees table in the following format? $6000.00
Mark for Review
(1) Points
SELECT TO_CHAR(salary, '$99999') SALARY
FROM employees
Correct
6. If you use the RR format when writing a query using the date 27-Oct-17
and the year is 2001, what year would be the result?
Mark for Review
(1) Points
1917
2017 (*)
1901
2001
Incorrect. Refer to Section 5 Lesson 1.
(1) Points
A value of 0 would be displayed. (*)
The statement would fail because values cannot be divided by 0.
A value of 10 would be displayed.
The statement would fail because values cannot be divided by null.
Correct
(1) Points
King, null
Kochhar, 100
Vargas, 124
Zlotkey, .2
Statement will fail
King, -1
Kochhar, 100
Vargas, 124
Zlotkey, 100
King, -1
Kochhar, 100
Vargas, 124
Zlotkey, .2 (*)
Correct
(1) Points
NVL, NVL2, and COALESCE can be used with group functions to replace null
values. (*)
COALESCE, but not NVL and NVL2, can be used with group functions to
replace null values.
NVL and NVL2, but not COALESCE, can be used with group functions to
replace null values.
NVL and COALESCE, but not NVL2, can be used with group functions to
replace null values.
Correct
(1) Points
SELECT TO_NUMBER(tuition_balance, 0), TO_NUMBER (housing_balance, 0),
tutition_balance + housing_balance "Balance Due"
FROM student_accounts;
SELECT NVL(tuition_balance, 0), NVL (housing_balance), tuition_balance +
housing_balance "Balance Due"
FROM student_accounts;
SELECT NVL (tuition_balance + housing_balance, 0) "Balance Due"
FROM student_accounts; (*)
SELECT tuition_balance + housing_balance
FROM student_accounts;
Correct
(1) Points
True
False (*)
Correct
(1) Points
zero
Null
ZERO
The statement fails (*)
Correct
(1) Points
NULLIF
DESCRIBE
CASE (*)
WHERE
Correct
14. Which statement will return a listing of last names, salaries, and a rating
of 'Low', 'Medium', 'Good' or 'Excellent' depending on the salary value?
Mark for Review
(1) Points
SELECT last_name,sal,
(CASE WHEN sal<5000 THEN 'Low'
WHEN sal<10000 THEN 'Medium'
WHEN sal<20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees;
SELECT last_name,salary,
(CASE WHEN salary<5000 THEN 'Low'
WHEN sal <10000 THEN 'Medium'
WHEN sal <20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees;
SELECT last_name,salary,
(CASE WHEN salary<5000 THEN 'Low'
WHEN salary<10000 THEN 'Medium'
WHEN salary<20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees; (*)
SELECT last_name,salary,
(RATING WHEN salary<5000 THEN 'Low'
WHEN salary<10000 THEN 'Medium'
WHEN salary<20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees;
Incorrect. Refer to Section 5 Lesson 3.
(1) Points
True (*)
False
Correct