0
0
Supabasecloud~10 mins

Cost optimization strategies in Supabase - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
Aselect
Bupdate
Cinsert
Dfrom
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.
2fill in blank
medium

Complete 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'
Aeq
Bneq
Cgt
Dlt
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.
3fill in blank
hard

Fix 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'
Ainsert
Bupdate
Cselect
Ddelete
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.
4fill in blank
hard

Fill 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'
Ainsert
Bstatus
Cupdate
Dbudget_limit
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.
5fill in blank
hard

Fill 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'
Aeq
Bgt
Ctrue
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using eq filters for exact match, not greater than.
Using false orders descending, not ascending.