runtime
73 / 139

task NULL handling · easy

Predict: unknown prices in a filter

Predict the products returned by a filter for list prices other than 1.25.

what to return

Columns
stock_codelist_price in this order
Rows
any order
Watch for
Use only the sample rows shown. NULL is not zero or empty text. Keep duplicate rows.
Skill
Reason about the exact result of a fixed SQL query. Refresher: Understand NULL →

data you can query

price_sample2 columns · 5 rows
stock_codetextlist_pricedecimal
A1.25
B2.5
CNULL
D1.25
ENULL
stock_codetext
A
list_pricedecimal
1.25
stock_codetext
B
list_pricedecimal
2.5
stock_codetext
C
list_pricedecimal
NULL
stock_codetext
D
list_pricedecimal
1.25
stock_codetext
E
list_pricedecimal
NULL

all 5 rows

predict.sql
SELECT stock_code, list_price
FROM price_sample
WHERE list_price <> 1.25
prediction.json

Enter the rows you think the query returns, column order stock_code, list_price. JSON array of rows — numbers bare, text in quotes, null for NULL. Example: [ [ 1, null ] ]. Row order does not matter.

 
Output

Hints and the answer are always available. Using them counts the question as solved with help.

Predict: unknown prices in a filter — SQL practice · Runtime