0
0
Supabasecloud~10 mins

Why Postgres powers Supabase - Test Your Understanding

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

Complete the code to create a new table in Supabase using SQL.

Supabase
CREATE TABLE [1] (id SERIAL PRIMARY KEY, name TEXT, active BOOLEAN DEFAULT true);
Drag options to blanks, or click blank then click option'
Astorage
Bfunctions
Cdatabase
Dusers
Attempts:
3 left
💡 Hint
Common Mistakes
Using reserved keywords as table names
Choosing unrelated names like 'storage'
2fill in blank
medium

Complete the code to insert a new user into the users table.

Supabase
INSERT INTO users (name) VALUES ([1]);
Drag options to blanks, or click blank then click option'
A'John Doe'
B"John Doe"
CJohn Doe
DJohn_Doe
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around strings
Using double quotes which are for identifiers
3fill in blank
hard

Fix the error in the SQL query to select all users.

Supabase
SELECT * FROM [1];
Drag options to blanks, or click blank then click option'
Auser_table
Buser
Cusers
Dtable_users
Attempts:
3 left
💡 Hint
Common Mistakes
Using singular 'user' instead of plural 'users'
Guessing table names incorrectly
4fill in blank
hard

Fill both blanks to create a Supabase client and connect to the database.

Supabase
const supabase = createClient([1], [2]);
Drag options to blanks, or click blank then click option'
A'https://xyzcompany.supabase.co'
B'public-anonymous-key'
C'localhost'
D'admin-key'
Attempts:
3 left
💡 Hint
Common Mistakes
Using localhost instead of the real URL
Using admin key on client side
5fill in blank
hard

Fill all three blanks to write a query that fetches active users from the users table.

Supabase
const { data, error } = await supabase.from([1]).select([2]).eq([3], true);
Drag options to blanks, or click blank then click option'
A'users'
B'*'
C'active'
D'id'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong table name
Selecting specific columns instead of all
Filtering by wrong column