Back to Practice
#0379
Preview Price Increase
EasySQL15 min10 XP
Problem
Return product, old_price, and new_price where new_price is price increased by 10%.
Why This Matters
SQL interviews usually test whether you can turn a business question into the right rows, grouping level, join type, and edge-case behavior.
Schema
products(product TEXT, price REAL)
Examples
Example 1
InputBook price 100, Pen price 10
Output110 and 11
A SELECT preview is safer than updating blindly.
Constraints
- Return only the requested columns.
- Use deterministic ORDER BY when multiple rows are returned.
- Assume SQLite-compatible SQL unless the prompt states otherwise.
CodeSQL
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core SQL case
InputBook price 100, Pen price 10
Expected[["Book",100,110.00000000000001],["Pen",10,11]]
A SELECT preview is safer than updating blindly.
Hidden Test Categories
Empty or missing matchesDuplicate rows or tiesNULL values where the pattern commonly breaks