0
0
Supabasecloud~10 mins

Seed data management 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 seed data into a Supabase table.

Supabase
await supabase.from('users').insert({ name: [1] })
Drag options to blanks, or click blank then click option'
A'Alice'
Bname
C'users'
Dinsert
Attempts:
3 left
💡 Hint
Common Mistakes
Using the column name instead of a value.
Omitting quotes around string values.
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 or update instead of select.
Forgetting to call the method with parentheses.
3fill in blank
hard

Fix the error in the seed script to correctly insert multiple rows.

Supabase
await supabase.from('orders').insert([1])
Drag options to blanks, or click blank then click option'
A[{ id: 1, item: 'Book' }, { id: 2, item: 'Pen' }]
B{ id: 1, item: 'Book' }, { id: 2, item: 'Pen' }
C[id: 1, item: 'Book', id: 2, item: 'Pen']
D{ id: 1, item: 'Book' }
Attempts:
3 left
💡 Hint
Common Mistakes
Passing multiple objects without an array.
Using incorrect array syntax.
4fill in blank
hard

Fill both blanks to update a user's email where id equals 5.

Supabase
await supabase.from('users').update({ email: [1] }).[2]('id', 5)
Drag options to blanks, or click blank then click option'
A'newemail@example.com'
Bfilter
Ceq
Dselect
Attempts:
3 left
💡 Hint
Common Mistakes
Using filter instead of eq for condition.
Not quoting the email string.
5fill in blank
hard

Fill all three blanks to delete rows from 'sessions' where 'active' is false.

Supabase
await supabase.from([1]).delete().[2]('active', [3], false)
Drag options to blanks, or click blank then click option'
A'sessions'
Beq
Cfilter
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using select instead of eq.
Mixing up the order of filter and eq.