SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Price on a Given Date

Unsolved

Every product launched at a price of 10. price_changes logs each later change with the date it took effect. A product's price on a date is the new_price of its most recent change on or before that date; if it had no change by then, its price is still 10. Every product that appears in price_changes must be reported. Write an SQL query that returns product_id and price as of 2025-08-16. Order the results by product_id ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
Classic pattern · not tied to a specific company

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM price_changes
Full source dataset
6 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine