
SQL Interview: How to Calculate Revenue from Loyal Customers
If you’re preparing for SQL interview questions for data analyst or data scientist roles, you’ll often encounter real-world business scenarios where you need to write queries that not only return correct results but also demonstrate structured problem-solving.
In this post, we’ll walk through an actual SQL interview-style problem that a major U.S. hotel chain could ask during a data role interview. The challenge involves identifying loyal customers and calculating the percentage of total revenue they contributed in a given year.
Imagine you are an analyst for a major hotel chain with locations across the United States. The marketing team is planning a new promotion focused on loyal customers. Before launching it, they want to know: