Podcast
Questions and Answers
Which query can be used to display the unique promotion costs in each promotion category?
Which query can be used to display the unique promotion costs in each promotion category?
- SELECT promo_category, MAX(promo_cost) FROM promotions GROUP BY promo_category;
- SELECT promo_category, AVG(promo_cost) FROM promotions GROUP BY promo_category;
- SELECT promo_category, SUM(promo_cost) FROM promotions GROUP BY promo_category;
- SELECT DISTINCT promo_cost, promo_category FROM promotions ORDER BY promo_cost;
- SELECT DISTINCT promo_category, promo_cost FROM promotions ORDER BY promo_category; (correct)
Which expression can be used to calculate the total price including surcharge and discount for a product?
Which expression can be used to calculate the total price including surcharge and discount for a product?
- unit_price + (surcharge * discount)
- (unit_price * 0.15 / (4.75 + 552.25))
- (unit_price * surcharge) - discount
- unit_price + surcharge - discount (correct)
- unit_price || 5 - discount + surcharge
Which query can be used to calculate the difference in days between the expiry date and delivery date for a product?
Which query can be used to calculate the difference in days between the expiry date and delivery date for a product?
- SELECT product_id, (expiry_date / delivery_date) AS days_difference FROM products;
- SELECT product_id, EXTRACT(DAY FROM (expiry_date - delivery_date)) AS days_difference FROM products;
- SELECT product_id, (expiry_date + delivery_date) AS days_difference FROM products;
- SELECT product_id, DATEDIFF(day, delivery_date, expiry_date) AS days_difference FROM products;
- SELECT product_id, (expiry_date - delivery_date) AS days_difference FROM products; (correct)
Which query can be used to display the product name and unit price with a 10% discount included?
Which query can be used to display the product name and unit price with a 10% discount included?
Which query can be used to display the total cost of all promotions in each category?
Which query can be used to display the total cost of all promotions in each category?