8 Topgolf SQL Interview Questions (Updated 2024)

Updated on

October 31, 2024

At Topgolf Callaway Brands, SQL is used to examine how customers interact with their virtual golf games, helping them understand which features keep players coming back for more. It also helps them optimize their inventory management for golfing equipment, ensuring they have the right clubs and gear available when customers need them, this is why Topgolf always evaluates jobseekers with SQL questions in interviews for Data Science and Data Engineering positions.

To help prep you for the Topgolf SQL interview, here's 8 Topgolf Callaway Brands SQL interview questions – can you solve them?

Topgolf SQL Interview Questions

8 Topgolf Callaway Brands SQL Interview Questions

SQL Question 1: Identifying Top Spenders at Topgolf

Topgolf makes most of its revenue from game fees and food & drinks. As an analyst for Topgolf, identify the customers who spend the most on games and on food & drinks separately. You have been provided with two tables which have the following data:

Example Input:

booking_iduser_idgame_dategame_fee
00100106/08/2022 00:00:0075
00200206/10/2022 00:00:0050
00300306/18/2022 00:00:00100
00400107/26/2022 00:00:00150
00500207/05/2022 00:00:0075

Example Input:

order_iduser_idorder_datetotal_cost
A00100106/08/2022 00:00:0040
A00200306/10/2022 00:00:0075
A00300106/18/2022 00:00:0065
A00400207/26/2022 00:00:0080
A00500307/05/2022 00:00:0090

Answer:


This solution identifies the top 5 customers who spend the most on games first, and then food & drinks. The function aggregates the total expenses by customers, and the clause sorts the customers in descending order of their total expenses. Finally, the clause selects the top 5 customers.

To practice a related super-user data analysis question on DataLemur's free online SQL code editor, try this Microsoft Teams Power User SQL Interview Question:

Microsoft SQL Interview Question: Teams Super User

Check out the latest news from Topgolf and discover how they are continuously evolving the game of golf and entertainment! Keeping up with Topgolf's updates can offer you a better understanding of their impact on the leisure industry and their commitment to engaging customers.

SQL Question 2: Top 3 Department Salaries

Given a table of Topgolf employee salary data, write a SQL query to find the top 3 highest earning employees within each department.

Topgolf Example Input:

employee_idnamesalarydepartment_id
1Emma Thompson38001
2Daniel Rodriguez22301
3Olivia Smith20001
4Noah Johnson68002
5Sophia Martinez17501
8William Davis68002
10James Anderson40001

Example Input:

department_iddepartment_name
1Data Analytics
2Data Science

Example Output:

department_namenamesalary
Data AnalyticsJames Anderson4000
Data AnalyticsEmma Thompson3800
Data AnalyticsDaniel Rodriguez2230
Data ScienceNoah Johnson6800
Data ScienceWilliam Davis6800

Try this question interactively on DataLemur:

Top 3 Department Salaries

Answer:

We use the DENSE_RANK() window function to generate unique ranks for each employee's salary within their department, with higher salaries receiving lower ranks. Then, we wrap this up in a CTE and filter the employees with a ranking of 3 or lower.


If the solution above is tough, you can find a detailed solution here: Top 3 Department Salaries.

SQL Question 3: Can you explain the distinction between a correlated and a non-correlated sub-query?

A correlated sub-query is one that is linked to the outer query and cannot be executed on its own. It uses the outer query to filter or transform data by referencing a column from the outer query, while the outer query uses the results of the inner query. On the other hand, a non-correlated sub-query is independent of the outer query and can be executed on its own. It does not reference any columns from the outer query and is used to retrieve additional data for the outer query.

Correlated sub-queries are slower to execute, as they have to be re-evaluated for each row of the outer query, while non-correlated sub-queries are faster, as they only have to be executed once.

Topgolf Callaway Brands SQL Interview Questions

SQL Question 4: Calculating Monthly Average Visits per Bay

Topgolf operates several golf ranges where groups of people can rent a "bay" to play in for certain time length. You are given the table which contains information about the bookings made by the customers. Each row represents a unique booking, with information about the , , , the and of the booking.

The question is:

"Write a SQL query to find the monthly average bookings per bay. Also include the total number of bookings for each bay in each month. The management wants this data to analyze the utilization of their facilities by month and bay."

Example Input:

booking_idbay_idcustomer_idstart_timeend_time
201A112021-06-01 09:00:002021-06-01 11:00:00
202B122021-06-08 14:30:002021-06-08 16:30:00
203A132021-06-10 18:00:002021-06-10 20:00:00
204A142021-07-01 09:00:002021-07-01 11:00:00
205B112021-07-10 14:00:002021-07-10 16:00:00
206B122021-07-15 18:30:002021-07-15 20:30:00

Expected Output:

monthbay_idavg_bookings_per_baytotal_bookings
6A12.02
6B11.01
7A11.01
7B12.02

Answer:


The query first extracts the month from the as and then groups by and . The function then counts total bookings per month for each bay. To calculate average bookings per day per bay, the total bookings is divided by the number of unique days in each month for each bay. The result is sorted by and .

To solve a similar window function interview problem which uses RANK() on DataLemur's free online SQL coding environment, solve this Amazon SQL question asked in a BI Engineer interview:

Amazon Business Intelligence SQL Question

SQL Question 5: What are the similarities and differences between a clustered index and non-clustered index?

Clustered and non-clustered indexes are both used to improve query performance, but they differ in how they are implemented.

A clustered index determines the physical order of the data rows in a table, while a non-clustered index does not. As a result, a table can have only one clustered index, but it can have multiple non-clustered indexes.

In terms of query efficiency & performance, a clustered index is generally faster for SELECT queries (reads) but updates (writes) to a clustered index are slower, as they require the data rows to be physically rearranged.

SQL Question 6: Find the average score of each venue

Topgolf has several venues around the world. Users can rate and review these venues. The data about user reviews is stored in the table. Write a SQL query to fetch the average score of each Topgolf venue based on user reviews.

Example Input:

review_idvenue_iduser_idsubmit_datestars
101150112/07/2021 00:00:004
102251112/08/2021 00:00:005
103153212/09/2021 00:00:003
104353212/12/2021 00:00:004
105251112/13/2021 00:00:004
106150112/14/2021 00:00:005

Answer:


In this query, we use to group the rows by . Then, we use to calculate the average score for each group. The result is a list of Topgolf venues and their respective average scores based on user reviews.

Example Output:
venue_idaverage_score
14.0
24.5
34.0

SQL Question 7: Database transactions are supposed to be atomic, consistent, isolated, & durable. What does each term mean?

A DBMS (database management system), in order to ensure transactions are relaible and don't ruin the integrity of the data, tries to mantain the following ACID properties: Atomicity, Consistency, Isolation, and Durability.

To make this concept more concrete, here is what each of the ACID properties would mean in the context of banking transactions:

  • Atomicity: a transaction is either completed fully, or not complete at all. For example, if a customer is transferring money from one account to another, the transaction should either transfer the full amount or none at all.
  • Consistency: a transaction will only be completed if it follows all database constraints and checks. For example, if a customer is withdrawing money from an account, the transaction should only be completed if the account has sufficient funds available, otherwise the transaction is rejected
  • Isolation: ensures that concurrent transactions are isolated from each other, so that the changes made by one transaction cannot be seen by another transaction. This isolation prevents race conditions, like two customers trying to withdraw money from the same account at the same time.
  • Durability: ensures that once a transaction has been committed and completed, the changes are permanent. A reset / shutdown of the database shouldn't erase someone's savings accounts!

SQL Question 8: Analyze Topgolf Customers and Bookings

A very common SQL interview question might be something like this:

Topgolf maintains a database of their customers and their bookings. Write a SQL query that would join the table with the table to determine which customers booked more than or equal to 2 unique bays in August 2022.

Example Input:

customer_idfirst_namelast_nameemail
10001JohnDoejohn.doe@email.com
10002JaneSmithjane.smith@email.com
10003BobJohnsonbob.johnson@email.com

Example Input:

booking_idcustomer_idbay_idbooking_date
2000110001108/14/2022 10:00:00
2000210001208/15/2022 12:00:00
2000310002108/16/2022 13:00:00
2000410003208/17/2022 14:00:00
2000510003308/25/2022 15:00:00

Answer:

Here is a possible solution, assuming the database is running PostgreSQL:


The SQL query uses a subquery for extracting all customers' bookings in August 2022 and groups them by where the number of unique is more than or equal to 2. This subquery is then joined with the customers' table to get the details of the customers who have made the specified bookings.

Because joins come up so often during SQL interviews, try this interactive Snapchat Join SQL question:

Snapchat SQL Interview question using JOINS

How To Prepare for the Topgolf SQL Interview

Assuming that you've already got basic SQL skills, the next best tip we have to prepare for the Topgolf SQL interview is to solve as many practice SQL interview questions as you can! Besides solving the above Topgolf SQL interview questions, you should also solve the 200+ FAANG SQL Questions on DataLemur which come from companies like Netflix, Airbnb, and Amazon.

DataLemur Questions

Each problem on DataLemur has multiple hints, step-by-step solutions and most importantly, there's an online SQL coding environment so you can easily right in the browser your query and have it graded.

To prep for the Topgolf SQL interview you can also be a great idea to solve interview questions from other hospitality and restaurant companies like:

In case your SQL query skills are weak, don't worry about diving straight into solving questions – go learn SQL with this SQL tutorial for Data Analytics.

SQL tutorial for Data Scientists & Analysts

This tutorial covers SQL topics like RANK vs. DENSE RANK and handling dates – both of which pop up routinely in Topgolf SQL assessments.

Topgolf Callaway Brands Data Science Interview Tips

What Do Topgolf Data Science Interviews Cover?

In addition to SQL interview questions, the other topics tested in the Topgolf Data Science Interview include:

Topgolf Data Scientist

How To Prepare for Topgolf Data Science Interviews?

To prepare for Topgolf Data Science interviews read the book Ace the Data Science Interview because it's got:

  • 201 interview questions sourced from Facebook, Google, & Amazon
  • a crash course covering SQL, Product-Sense & ML
  • over 1000+ reviews on Amazon & 4.5-star rating

Ace the DS Interview

Don't ignore the behavioral interview – prep for it using this guide on behavioral interview questions.

© 2025 DataLemur, Inc

Career Resources

Free 9-Day Data Interview Crash CourseFree SQL Tutorial for Data AnalyticsSQL Interview Cheat Sheet PDFUltimate SQL Interview GuideAce the Data Job Hunt Video CourseAce the Data Science InterviewBest Books for Data AnalystsSQL Squid Game