0
0
Supabasecloud~10 mins

Why optimization prevents slow queries in 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 select all columns from the users table.

Supabase
SELECT [1] FROM users;
Drag options to blanks, or click blank then click option'
A*
Bid
Cemail
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting only one column when all are needed.
Using column names without quotes.
2fill in blank
medium

Complete the code to filter users with age greater than 30.

Supabase
SELECT * FROM users WHERE age [1] 30;
Drag options to blanks, or click blank then click option'
A<=
B=
C<
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' which filters for ages less than 30.
Using '=' which filters for age exactly 30.
3fill in blank
hard

Fix the error in the query to count users grouped by country.

Supabase
SELECT country, COUNT(*) [1] users GROUP BY country;
Drag options to blanks, or click blank then click option'
AIN
BON
CFROM
DWHERE
Attempts:
3 left
💡 Hint
Common Mistakes
Using WHERE instead of FROM causes syntax errors.
Using ON or IN in place of FROM is incorrect here.
4fill in blank
hard

Fill both blanks to optimize the query by indexing the age column and filtering efficiently.

Supabase
CREATE INDEX [1] ON users([2]);
Drag options to blanks, or click blank then click option'
Aidx_users_age
Bage
Cname
Demail
Attempts:
3 left
💡 Hint
Common Mistakes
Indexing columns not used in filters does not improve query speed.
Using invalid index names causes errors.
5fill in blank
hard

Fill all three blanks to write a query that selects user names, filters by age greater than 25, and orders results by name ascending.

Supabase
SELECT [1] FROM users WHERE age [2] 25 ORDER BY [3] ASC;
Drag options to blanks, or click blank then click option'
Aname
B>
Dage
Attempts:
3 left
💡 Hint
Common Mistakes
Ordering by age instead of name changes the output order.
Using '<' instead of '>' filters the wrong age group.