Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Customers from Specific Cities with Orders | Subqueries in E-commerce Analytics
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Subqueries in SQL

bookChallenge: Customers from Specific Cities with Orders

Task

Swipe to start coding

Find all customers from either 'New York' or 'Los Angeles' who have placed at least one order.

  • Select the customer_id, name, and city columns from the customers table.
  • Only include customers whose city is either 'New York' or 'Los Angeles'.
  • Only include customers who have at least one matching customer_id in the orders table.
  • Use a subquery in your solution.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 5
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Customers from Specific Cities with Orders

Swipe to show menu

Task

Swipe to start coding

Find all customers from either 'New York' or 'Los Angeles' who have placed at least one order.

  • Select the customer_id, name, and city columns from the customers table.
  • Only include customers whose city is either 'New York' or 'Los Angeles'.
  • Only include customers who have at least one matching customer_id in the orders table.
  • Use a subquery in your solution.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 5
single

single

some-alt