Unit 3, lesson 7 · Unit 3 challenge
Unit 3 review: cleaning text
Unit 3 challenge: clean up the mailing list
This challenge uses everything from this unit. Build it one column at a time and run the query after each, checking a few rows by eye: the trimmed name, then the email, then the brackets around it, then the city, and the filter last.
SELECT TRIM(full_name) AS name,
LENGTH(TRIM(full_name)) AS characters
FROM signups;Your task
Build the newsletter mailing list. For every sign-up whose email contains an @, return three columns. id: the sign-up's id. contact: the name with the spaces at either end removed, then a space, then the email trimmed and in lowercase inside angle brackets, like 'Ava Brooks <ava.brooks@gmail.com>'. city: the city trimmed and in capitals.
Tables you will use: signups
Try it in your browserFree, no sign-up. Your query is checked as you go.