Chapter 9 · Interview Level
09. Second Most Expensive Product
Easy10 XPE-Commerce
Find the product with the second highest price. Return its name and price. If there are ties for the highest price, the second highest should be the next distinct price below the maximum.
Tables
- PKidINT
- nameTEXT
- FKcategory_id→ categories.idINT
- priceREAL
- costREAL
- stock_quantityINT
- created_atTIMESTAMP
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.