Attached is the work with my current progress. The query should call only those
ID: 3739658 • Letter: A
Question
Attached is the work with my current progress. The query should call only those products with distinct discount_percent listings. As it is now, I can't figure how to scale it back to 6 columns.
43 4 45 46 47 48 that have the same discount percent as another product. (6 rows) 49 50 51 SELECT product_name, discount percent 52 53 ORDER BY product_name 54 Write a SELECT statement that returns the name and discount percent of each product that has a unique discount percent. In other words, don't include products Sort the results by the product-name column. FROM products 56 100% ^ 23:53 Result GridFilter Rows Q Search Export: product_name Fender Precision Fender Stratocaster Gibson Les Paul Gibson SG Hofner lcon Ludwig 5-piece Drum Set with Cymbals Rodriguez Caballero 11 Tama 5-Piece Drum Set with Cymbals Washburn D10S Yamaha DGX 640 88-Key Digital Piano Yamaha FG7nnS discount_percent 30.00 30.00 30.00 52.00 25.00 30.00 39.00 15.00 0.00 35.00 38 products 16Explanation / Answer
If anything wrong, please give me comment...
SELECT p1.product_name, p1.discount_percent
FROM products p1
WHERE 1 = (
SELECT COUNT(*)
FROM products p2
WHERE p1.discount_percent = p2.discount_percent
)
ORDER BY p1.product_name;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.