BasicsLIKEStringsGoogleAmazonMeta
Table
users(user_id INT, email VARCHAR)
Task
From users(user_id, email), return user_id and email for all users whose email ends with @gmail.com (case-insensitive), ordered by user_id ASC.
Why It Matters: LIKE wildcard filtering (%@gmail.com) lets analysts segment users by email domain, URL prefix, or product SKU pattern.
Output columns: user_id, email
Example
Input — users
| user_id | |
|---|---|
| 1 | a@gmail.com |
| 2 | b@yahoo.com |
| 3 | C@GMAIL.COM |
Expected Output
| user_id | |
|---|---|
| 1 | a@gmail.com |
| 3 | C@GMAIL.COM |
Explanation: Matches only rows whose email ends with @gmail.com, excluding other domains.
Requirements
- Exact output columns:
user_id,email - Row order: Exact
ORDER BYorder is checked by the grader. - Query type: Write a single read-only Standard SQL
SELECT(orWITH ... SELECT) query.
Constraints & Evaluation Criteria
- Case-insensitive match; return `user_id, email` ordered by `user_id ASC`.
Hints
SQL⌘/Ctrl+Enter to Run · ⌘/Ctrl+Shift+Enter to Submit
Loading Code Editor...
+1 Hidden Submit Case
Input / Scenario
users (3 rows)
Expected Output / Criteria
2 row(s): (1, a@gmail.com); (3, C@GMAIL.COM)