0
0
Supabasecloud~10 mins

CRUD operations with supabase-js - 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'
Aselect
Bdelete
Cinsert
Dupdate
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
Bdelete
Cupdate
Dselect
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'insert' when trying to read data.
Using 'delete' instead of 'select'.
3fill in blank
hard

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

Supabase
const { data, error } = await supabase.from('users').update({ age: 31 }).[1]('id', 5);
Drag options to blanks, or click blank then click option'
Awhere
Beq
Cfilter
Dmatch
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'where' which is not a Supabase-js method.
Using 'filter' which is not valid here.
4fill in blank
hard

Fill both blanks to delete a product with id 10 from the 'products' table.

Supabase
const { data, error } = await supabase.from('products').[1]().[2]('id', 10);
Drag options to blanks, or click blank then click option'
Adelete
Beq
Cselect
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'select' instead of 'delete' to remove rows.
Using 'update' instead of 'delete'.
5fill in blank
hard

Fill all three blanks to select users older than 25 from the 'users' table.

Supabase
const { data, error } = await supabase.from('users').[1]('*').[2]('age', '[3]', 25);
Drag options to blanks, or click blank then click option'
Aselect
Bfilter
Cgt
Dlt
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'lt' instead of 'gt' for age comparison.
Using 'eq' instead of 'gt' for greater than.