What would be the outcome of the above SQL statement?

View the exhibits and examine the structures of the COSTS and PROMOTIONS tables.


Evaluate the following SQL statement:
SQL> SELECT prod_id FROM costs
WHERE promo_id IN (SELECT promo_id FROM promotions
WHERE promo_cost < ALL
(SELECT MAX(promo_cost) FROM promotions
GROUP BY (promo_end_datepromo_ begin_date)));
What would be the outcome of the above SQL statement?
A. It displays prod IDs in the promo with the lowest cost.
B. It displays prod IDs in the promos with the lowest cost in the same time interval.
C. It displays prod IDs in the promos with the highest cost in the same time interval.
D. It displays prod IDs in the promos which cost less than the highest cost in the same time interval.

Download Printable PDF. VALID exam to help you PASS.

3 thoughts on “What would be the outcome of the above SQL statement?

  1. non-correlated subquery -> That the subquery can be run independently of the outer query. Basically, the subquery has no relationship with the outer query.

    correlated subquery -> the subquery CAN NOT be run independently of the outer query. First, a row is processed in the outer query. Then, for that particular row the subquery is executed so for each row processed by the outer query, the subquery will also be processed.

    2 – 1ª row is fetchd/processed from the table in the OUTER QUERY
    4 – 2º rows returned to inner query
    1 – 3º Where is evaluated
    3 – 4º the process is repeated rows for rows

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.