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:

citycontact
LondonEmma Clark <emma.clark@mail.com>
LondonLeo Walker <leo.walker@mail.com>
LondonOlivia Brown <olivia@brownfamily.net>
ManchesterJack Harris <jack@harris.io>
ManchesterLiam 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

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

3/3