Ch. 5 Flashcards
Single-Row functions may be used in which of the following (select all that apply)
- SELECT
- WHERE
- FROM
- ORDER BY
- SELECT
- WHERE
- ORDER BY
What would be returned by the following:
SELECT *
FROM countries
WHERE UPPER(country_name) LIKE ‘%U%S%A%’;
- United States of America
- United States
- Australia
- usa
All are true
Which of the following functions can be used to determine how many months a book has been available, from the time it is published until today’s date?
- MONTH
- MON
- MONTH_BETWEEN
- none of the choices are correct.
- none of these choices are correct
Which of the following function(s) return a number? Choose all that apply.
- SUBSTR
- INSTR
- MONTHS_BETWEEN
- UPPER
- LRNGTH
- INSTR
- MONTHS_BETWEEN
What is returned by the following function:
ROUND(‘17-JUN-20’, ‘MM’)
- 01-JUL-20
- 01-JUN-20
- 01-MAY-20
- 01-JAN-20
- 01-JUL-20
Which of the following is a valid SQL statement?
- SELECT ROUND(TRUNC(125.38, 0) FROM DUAL;
- SELECT SUBSTR(ROUND(14.87, 2, 1), -4, 1) FROM DUAL;
- SELECT RPAD(salary, “*” ) FROM DUAL;
- SELECT TRUNC(ROUND(124.67, 1) ) FROM DUAL;
- SELECT TRUNC(ROUND(124.67, 1) ) FROM DUAL;
Which of the following functions returns a number?
- UPPER
- SUBSTR
- INSTR
- TRIM
- INSTR
What would be returned by the following:
SELECT *
FROM countries
WHERE UPPER(country_name) LIKE ‘u%s%a%’;
- USA
- United States of America
- Any countries with ‘u’, ‘s’, ‘a’ in their name, in that order
- no rows returned
- no rows returned
What Oracle SQL function could be used to remove leading and trailing characters at the same time?
- TRIM BOTH
- LTRIM
- TRIM LEADING
- RTRIM
- TRIM BOTH
What is returned when the following statement is executed?
SELECT ROUND(15607.329, -1)
FROM DUAL;
- 15607.3
- Syntax error- a negative number is not permitted as the second parameter of the ROUND function
- 15610
- 15607
- 15610