โ† All 1Z0-071 Flashcard Decks

Using Subqueries Flashcards

6 cards from real 1Z0-071 practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Using Subqueries flashcards as text
  1. What is a correlated subquery?

    Answer: A subquery that references a column from the outer query

    A correlated subquery references a column from the outer query and is re-executed for each row of the outer query.

  2. Which error occurs when a single-row operator is used with a multi-row subquery result?

    Answer: ORA-01427

    ORA-01427 'single-row subquery returns more than one row' is raised when = or < is used against a multi-row subquery.

  3. A subquery in the FROM clause is called a:

    Answer: Inline view

    A subquery placed in the FROM clause is called an inline view because it acts like a temporary named table.

  4. What does the ALL operator do when used with a subquery?

    Answer: Returns TRUE only if the condition is met for every row returned by the subquery

    ALL requires the comparison to be true for every value returned by the subquery.

  5. Which subquery type returns exactly one row and one column?

    Answer: Scalar subquery

    A scalar subquery returns a single row and a single column and can be used wherever a single value is expected.

  6. What is the correct way to find employees who earn more than the average salary?

    Answer: SELECT * FROM employees WHERE salary > (SELECT AVG(salary) FROM employees)

    A single-row subquery that returns AVG(salary) is placed in the WHERE clause to compare each employee's salary.