Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select the best plan for cost savings.
Supabase
const plan = supabase.[1]('plans').select('*').eq('type', 'basic')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using select instead of from causes an error because select is for columns.
Using insert or update is wrong because they modify data, not select.
✗ Incorrect
The from method is used to specify the table to query in Supabase.
2fill in blank
mediumComplete the code to filter cost optimization strategies by active status.
Supabase
const strategies = supabase.from('cost_strategies').select('*').[1]('status', 'active')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using neq would select rows not active, which is wrong here.
gt and lt are for greater or less than comparisons, not equality.
✗ Incorrect
The eq method filters rows where the column equals the given value.
3fill in blank
hardFix the error in the code to update a strategy's budget limit.
Supabase
const { data, error } = await supabase.from('cost_strategies').[1]({ budget_limit: 1000 }).eq('id', 5) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using select will not update data.
Insert adds new rows, not update existing ones.
Delete removes rows, not update.
✗ Incorrect
The update method is used to modify existing rows in Supabase.
4fill in blank
hardFill both blanks to insert a new cost optimization strategy with a name and status.
Supabase
const { data, error } = await supabase.from('cost_strategies').[1]({ name: 'Auto Scaling', [2]: 'active' }) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using update instead of insert will not add a new row.
Using budget_limit instead of status changes the wrong field.
✗ Incorrect
insert adds a new row, and status is the correct key for the status field.
5fill in blank
hardFill all three blanks to select strategies with budget limits greater than 500 and order by name ascending.
Supabase
const { data, error } = await supabase.from('cost_strategies').select('*').[1]('budget_limit', [2]).order('name', { ascending: [3] }) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using eq filters for exact match, not greater than.
Using false orders descending, not ascending.
✗ Incorrect
gt filters for values greater than 500, and true sets ascending order.