0
0
Supabasecloud~10 mins

Inserting and querying data 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 insert a new row into the 'users' table.

Supabase
const { data, error } = await supabase.from('users').[1]({ name: 'Alice', age: 30 })
Drag options to blanks, or click blank then click option'
Aupdate
Bdelete
Cinsert
Dselect
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'select' instead of 'insert' to add data.
Using 'update' when trying to add new rows.
2fill in blank
medium

Complete the code to select all rows from the 'products' table.

Supabase
const { data, error } = await supabase.from('products').[1]('*')
Drag options to blanks, or click blank then click option'
Ainsert
Bselect
Cupdate
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'insert' when trying to get data.
Forgetting to specify columns or using wrong method.
3fill in blank
hard

Fix the error in the code to update the 'age' of user with id 5.

Supabase
const { data, error } = await supabase.from('users').[1]({ age: 31 }).eq('id', 5)
Drag options to blanks, or click blank then click option'
Ainsert
Bselect
Cdelete
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'insert' to change data instead of 'update'.
Using 'select' when trying to modify data.
4fill in blank
hard

Fill both blanks to delete rows where 'status' is 'inactive' from the 'accounts' table.

Supabase
const { data, error } = await supabase.from('accounts').[1]().[2]('status', 'inactive')
Drag options to blanks, or click blank then click option'
Adelete
Bselect
Ceq
Dinsert
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'select' instead of 'delete' to remove data.
Not filtering rows correctly before deleting.
5fill in blank
hard

Fill all three blanks to select 'name' and 'email' from 'customers' where 'age' is greater than 25.

Supabase
const { data, error } = await supabase.from('customers').[1](['name', 'email']).[2]('age', [3], 25)
Drag options to blanks, or click blank then click option'
Aselect
Bfilter
Cgt
Dinsert
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'insert' instead of 'select' to get data.
Using wrong filter method or operator.