Trade-in Value

ASKED IN INTERVIEW
2pts
Apple

Problem Statement

Apple wants to automate the trade-in valuation for its older devices. The current policy assumes a fixed 20% yearly depreciation rate. This means every year, the device retains only 80% of its value from the previous year.

Write an SQL query to calculate the trade-in value of the iPhone 13 as of the current year (2026).

Rules:

  • The iPhone 13 was released in 2021 with an original price of $799.00.
  • Depreciation Formula: $Current Value = Original Price \times (0.80)^{years passed}$.
  • Years passed = 2026 - release_year.
  • Round the result to 2 decimal places.
  • Output columns: model_name, original_price, trade_in_value.

Table Schema:

  • ProductCatalog: model_name, release_year, original_price.
Tests your understanding of
Basic SQL, Mathematics, DateTime and Arithmetic

Input Tables

ProductCatalog
model_name(VARCHAR)release_year(INTEGER)original_price(DECIMAL)
iPhone 132021799
iPhone 122020699
iPhone 142022899
iPhone 112019699
iPhone SE2022429
MacBook Air2020999

Expected Output

model_name(VARCHAR)original_price(DECIMAL)trade_in_value(DECIMAL)
iPhone 13799261.82

Tags

EasyASKED IN INTERVIEWBasic SQLMathematicsDateTimeArithmetic
10-15 min
68%

Hints