Question 111

View the Exhibit and examine the structure of the SALES and PRODUCTS tables. (Choose two.)

In the SALES table, PROD_ID is the foreign key referencing PROD_ID in the PRODUCTS table. You must list each product ID and the number of times it has been sold.
Examine this query which is missing a JOIN operator:
SQL > SELECT p.prod_id, count(s.prod_id)
FROM products p ______________ sales s
ON p.prod_id = s.prod_id
GROUP BY p.prod_id;
Which two JOIN operations can be used to obtain the required output?
  • Question 112

    See the Exhibit and examine the structure of the PROMOTIONS table:

    Using the PROMOTIONS table,
    you need to find out the average cost for all promos in the range $0-2000 and $2000-5000 in category A.
    You issue the following SQL statements:

    What would be the outcome?
  • Question 113

    Which three statements are true about Data Manipulation Language (DML)? (Choose three.)
  • Question 114

    View the Exhibit and examine the details of PRODUCT_INFORMATION table.

    You have the requirement to display PRODUCT_NAME from the table where the CATEGORY_ID column has values 12 or 13, and the SUPPLIER_ID column has the value 102088. You executed the following SQL statement:
    SELECT product_name
    FROM product_information
    WHERE (category_id = 12 AND category_id = 13) AND supplier_id = 102088; Which statement is true regarding the execution of the query?
  • Question 115

    View the Exhibit and examine the structure of the PRODUCTS table. (Choose the best answer.)

    You must display the category with the maximum number of items.
    You issue this query:
    SQL > SELECT COUNT(*), prod_category_id
    FROM products
    GROUP BY prod_category_id
    HAVING COUNT(*) = (SELECT MAX(COUNT(*)) FROM porducts);
    What is the result?