Party Invitations
For its loyal customers, Pixel Shop is throwing Christmas parties in London and in Manchester, and the invitations go out by email. The team wants to invite the customers who live in one of these two cities and joined the shop before 2025; the newer customers will get their turn next year.
The email program needs two columns: city, as the party in each city has its own invitation, and contact, in the form that email uses: the name, a space and the email in angle brackets, such as Emma Clark <emma.clark@mail.com>. Sort the customers by city, and the customers of each city by name:
| city | contact |
|---|---|
| London | Emma Clark <emma.clark@mail.com> |
| London | Leo Walker <leo.walker@mail.com> |
| London | Olivia Brown <olivia@brownfamily.net> |
| Manchester | Jack Harris <jack@harris.io> |
| Manchester | Liam Turner <liam.t@mail.com> |
Grace Hall lives in London too, but she joined in 2025, so she isn't invited this year.
A tip: when a condition has both AND and OR, remember which of them goes first.
That's the whole project. With three lessons behind you, you've written the queries for a whole Christmas campaign: they choose rows by several conditions, sort them, pick the top ones and put texts together. In the next lesson, you'll learn functions, which round prices, cut texts apart and calculate with dates.
Instructions
Below the comment -- 3. Party invitations, write the query for the invitations.
Start programming for free
3/3