Ch. 5 Flashcards

1
Q

Single-Row functions may be used in which of the following (select all that apply)
- SELECT
- WHERE
- FROM
- ORDER BY

A
  • SELECT
  • WHERE
  • ORDER BY
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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
A

All are true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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.
A
  • none of these choices are correct
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following function(s) return a number? Choose all that apply.
- SUBSTR
- INSTR
- MONTHS_BETWEEN
- UPPER
- LRNGTH

A
  • INSTR
  • MONTHS_BETWEEN
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is returned by the following function:

ROUND(‘17-JUN-20’, ‘MM’)

  • 01-JUL-20
  • 01-JUN-20
  • 01-MAY-20
  • 01-JAN-20
A
  • 01-JUL-20
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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;
A
  • SELECT TRUNC(ROUND(124.67, 1) ) FROM DUAL;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following functions returns a number?

  • UPPER
  • SUBSTR
  • INSTR
  • TRIM
A
  • INSTR
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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
A
  • no rows returned
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What Oracle SQL function could be used to remove leading and trailing characters at the same time?

  • TRIM BOTH
  • LTRIM
  • TRIM LEADING
  • RTRIM
A
  • TRIM BOTH
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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
A
  • 15610
How well did you know this?
1
Not at all
2
3
4
5
Perfectly