Drill 5 of 12 in SQL Basics
0

SQL Basics · LIKE · wildcards

5. Customers with a .ca email

Concept: LIKE · wildcardsshow

LIKE matches text against a pattern. % stands for any run of characters (including none) and _ for exactly one. 'A%' starts with A, '%son' ends with son, '%data%' contains data.

Example (different data):

SELECT name
FROM employees
WHERE email LIKE '%@acme.com';

Your task

Support is moving Canadian customers to a new helpdesk. Country is self-reported, so they trust the email domain instead.

Return name and email of every customer whose email ends in .ca, sorted by name.

Solution unlocks after 3 more tries

Starting Postgres in your browser…

query.sql
Output

Write a query and press Run Query (Ctrl/⌘ + Enter).