Topfolio
Career TracksJob Hunt TrackerMicro Free CoursesTask CoursesPracticeInterview PracticeWork ExperienceProjects
Career TrackBlog
Support
Dashboard
Career TracksMicro Free CoursesTask Courses
SQL & Python
Interview Prep
Job Hunt TrackerWork ExperienceProjectsResume Feedback
CertificatesMy OrdersRefer & Earn
Join Community

Navigation

Dashboard
Learn
Career TracksMicro Free CoursesTask Courses
Practice
SQL & PythonInterview Prep
Career
Job Hunt TrackerWork ExperienceProjectsResume Feedback
My Stuff
CertificatesMy OrdersRefer & Earn
Join Community
Topfolio

Learn data analytics online. Real skills, real projects, real community.

courses

  • Career Tracks
  • Work Experience
  • Best Data Analyst Course in India
  • SQL Fundamentals
  • SQL Advanced
  • Python for Data
  • Micro Free Courses

practice

  • SQL Fundamentals Interview Test
  • SQL Advanced Coding Test
  • All Practice Tests

resources

  • How to Become a Data Analyst
  • SQL Interview Questions
  • Data Analyst Salary Guide
  • Free Datasets for Practice
  • SQL vs NoSQL Guide
  • Data Analyst vs Data Engineer vs Data Scientist

employers

  • Enterprise Screening
  • AI Proctoring Demo
  • Volume Pricing
  • Employer Portal

company

  • About
  • Terms
© 2026 Topfolio. All rights reserved.Made with ❤️ for aspiring analysts
Topfolio
Career TracksJob Hunt TrackerMicro Free CoursesTask CoursesPracticeInterview PracticeWork ExperienceProjects
Career TrackBlog
Support
Dashboard
Career TracksMicro Free CoursesTask Courses
SQL & Python
Interview Prep
Job Hunt TrackerWork ExperienceProjectsResume Feedback
CertificatesMy OrdersRefer & Earn
Join Community

Navigation

Dashboard
Learn
Career TracksMicro Free CoursesTask Courses
Practice
SQL & PythonInterview Prep
Career
Job Hunt TrackerWork ExperienceProjectsResume Feedback
My Stuff
CertificatesMy OrdersRefer & Earn
Join Community

EXISTS: Find Customers with Large Purchases

beginner~6 min15 pts
📊 View Insights

Problem

Use EXISTS to find customers who have made at least one purchase over $10. EXISTS is efficient for checking if related records exist.

Write a query using EXISTS to find customers with any invoice over $10.

Schema: Customer

ColumnType
CustomerIdINTEGER (Primary Key)
FirstNameTEXT
LastNameTEXT
CompanyTEXT
AddressTEXT
CityTEXT
StateTEXT
CountryTEXT
PostalCodeTEXT
PhoneTEXT
FaxTEXT
EmailTEXT
SupportRepIdINTEGER (Foreign Key → Employee.EmployeeId)

Schema: Invoice

ColumnType
InvoiceIdINTEGER (Primary Key)
CustomerIdINTEGER (Foreign Key → Customer.CustomerId)
InvoiceDateTIMESTAMP
BillingAddressTEXT
BillingCityTEXT
BillingStateTEXT
BillingCountryTEXT
BillingPostalCodeTEXT
TotalNUMERIC(10,2)

Requirements:

  • Use EXISTS with a subquery
  • Find customers with at least one invoice where Total > 10
  • Return FirstName, LastName, and Email
  • Order by LastName

EXISTS Syntax:

SELECT * FROM TableA a
WHERE EXISTS (SELECT 1 FROM TableB b WHERE b.foreign_key = a.primary_key AND condition)
SubqueryEXISTSCorrelated Subquery
📊
📊 View Question Telemetry & Insights
Failure rate, silent bug autopsy & optimal query construction
Inspect →

Master SQL & Data Analytics

Ready to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.

Explore the 12-Week Data Analyst Career Track

Related questions

  • Tracks Above Average Pricebeginner
  • Correlated Subquery: Above Genre Averageintermediate
  • NOT EXISTS: Artists Without Albumsbeginner
  • Scalar Subquery in SELECTbeginner
  • Nested Aggregation: Average of Totalsintermediate
  • Calculate Percentage of Totalintermediate
  • Customers Active in Multiple Yearsintermediate
  • Top 3 Spenders per Countryintermediate
SQL Editor

Run your code to see the result here.

Topfolio

Learn data analytics online. Real skills, real projects, real community.

courses

  • Career Tracks
  • Work Experience
  • Best Data Analyst Course in India
  • SQL Fundamentals
  • SQL Advanced
  • Python for Data
  • Micro Free Courses

practice

  • SQL Fundamentals Interview Test
  • SQL Advanced Coding Test
  • All Practice Tests

resources

  • How to Become a Data Analyst
  • SQL Interview Questions
  • Data Analyst Salary Guide
  • Free Datasets for Practice
  • SQL vs NoSQL Guide
  • Data Analyst vs Data Engineer vs Data Scientist

employers

  • Enterprise Screening
  • AI Proctoring Demo
  • Volume Pricing
  • Employer Portal

company

  • About
  • Terms
© 2026 Topfolio. All rights reserved.Made with ❤️ for aspiring analysts