9 Light & Wonder SQL Interview Questions (Updated 2024)

Updated on

October 31, 2024

At Light & Wonder, SQL is used for managing gaming datasets, helping them to analyze player behavior and preferences. It also allows them to optimize gaming experiences and promotions based on what players enjoy most, enhancing customer satisfaction and engagement, that is the reason why Light & Wonder asks SQL questions in interviews for Data Analytics, Data Science, and Data Engineering jobs.

Thus, to help you practice for the Light & Wonder SQL interview, we'll cover 9 Light & Wonder SQL interview questions in this article.

Light & Wonder SQL Interview Questions

9 Light & Wonder SQL Interview Questions

SQL Question 1: Calculate Monthly Average Ratings for Each Product

Light & Wonder is a company that sells various products and allows users to review and rate them. The review ratings range from 1 to 5 stars. The company maintains a table that keeps a record of each review submitted by the users. The table has the following columns:

  • : Unique ID of the review
  • : Unique ID of the user who reviewed
  • : Date the review was submitted
  • : Unique ID of the product that was reviewed
  • : Star rating given by the user

Your task is to write a SQL query to calculate the monthly average star rating for each product based on the reviews submitted.

Below is a snapshot of how your table looks like:

Example Input:

review_iduser_idsubmit_dateproduct_idstars
61711232022-08-06500014
78022652022-10-06698524
52933622022-18-06500013
63521922022-26-07698523
45179812022-05-07698522

Answer:

Before writing the SQL query, make sure that the field is of date or timestamp data type.

Here's a PostgreSQL query that uses window function to compute the monthly average star rating:


Example Output:

mthproduct_idavg_stars
6500013.5
6698524.0
7698522.5

The query first extracts the month from the field using the function. Then, it calculates the average for each for the extracted months using the function. The clause is used along with to compute the average for each product per month. Finally, the query orders the result by and .

To practice another window function question on DataLemur's free interactive coding environment, solve this Google SQL Interview Question:

Google SQL Interview Question

Dive into Light & Wonder's newsroom and discover the exciting developments that are shaping the future of technology and innovation! Keeping up with Light & Wonder's updates can help you understand the trends that are driving change in the tech landscape.

SQL Question 2: 2nd Largest Salary

Given a table of Light & Wonder employee salaries, write a SQL query to find the 2nd highest salary among all employees.

Light & Wonder Example Input:

employee_idsalary
12500
2800
31000
41200

Example Output:

second_highest_salary
1200

You can solve this problem directly within the browser on DataLemur:

2nd Highest Salary SQL Interview Question

Answer:


You can find a detailed solution with hints here: 2nd Highest Salary.

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

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

Here is an example of a correlated sub-query:


This query selects the and total sales of all Light & Wonder customers in the sales table whose are greater than the average of their own customer group. The sub-query in this case is correlated with the outer query, as it references the column from the outer query ().

Here is an example of a non-correlated sub-query:


The sub-query in this case is non-correlated, as it does not reference any columns from 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.

Light & Wonder SQL Interview Questions

SQL Question 4: Filter Customer Records for Light & Wonder

Given the table that includes information on each customer's city and their subscription status at Light & Wonder, write a SQL query to filter records down to only customers who live in either Seattle or San Francisco and have a current, active subscription. The relevant columns are (an integer), (a string), and (a string, where 'Active' means the customer is currently subscribed and 'Inactive' means they are not).

Example Input:

customer_idcitysubscription_status
1SeattleActive
2San FranciscoInactive
3New YorkActive
4SeattleInactive
5San FranciscoActive
6Los AngelesActive
7SeattleActive
8San FranciscoInactive

Example Output:

customer_idcitysubscription_status
1SeattleActive
5San FranciscoActive
7SeattleActive

Answer:


This query filters the 'customers' table for records where the customer's city is either Seattle or San Francisco () and the customer's subscription status is 'Active' (). If both of these conditions are true for a record, that record is returned in the output.

SQL Question 5: What does the constraint do?

A is a field in a table that references the of another table. It creates a link between the two tables and ensures that the data in the field is valid.

Say for example you had sales analytics data from Light & Wonder's CRM (customer-relationship management) tool.


The constraint ensures that the data in the field of the table is valid, and prevents the insertion of rows in the table that do not have corresponding entries in the table. It also helps to enforce the relationship between the two tables and can be used to ensure that data is not deleted from the table if there are still references to it in the table.

SQL Question 6: Calculate Average Light Intensity

Light & Wonder is a company that specializes in manufacturing and selling a variety of lighting solutions including smart bulbs which save usage data. Every smart bulb sends a monthly report of its daily average light intensity. As an analyst at Light & Wonder, can you write a SQL query to find the average daily light intensity for each smart bulb for the last month?

Example Input:

record_idbulb_idrecord_datedaily_light_intensity
10012022-11-01300
20012022-11-02360
30012022-11-03320
40022022-11-01250
50022022-11-02500
60022022-11-03480
70012022-12-01250
80022022-12-01500

Example Output:

bulb_idAvg_light_intensity_for_nov
001326.6667
002410

Answer:


This query firstly filters for records from the month of November. It then groups the records by the bulb id and calculates the average daily light intensity for each bulb. The function is used to compute the average light intensity, and the clause divides the data into groups by bulb id. The clause is used to limit the records to November only. With this query we can assess and compare the average daily use / intensity of each smart bulb for a specific time period. This can be beneficial for product improvement and customer usage patterns analysis.

To practice a very similar question try this interactive Google Odd and Even Measurements Question which is similar for calculating with IoT device data or this Amazon Average Review Ratings Question which is similar for averaging metrics over time.

SQL Question 7: Can you explain the concept of a constraint in SQL?

Constraints are just rules your DBMS has to follow when updating/inserting/deleting data.

Say you had a table of Light & Wonder products and a table of Light & Wonder customers. Here's some example SQL constraints you'd use:

NOT NULL: This constraint could be used to ensure that certain columns in the product and customer tables, such as the product name and customer email address, cannot contain NULL values.

UNIQUE: This constraint could be used to ensure that the product IDs and customer IDs are unique. This would prevent duplicate entries in the respective tables.

PRIMARY KEY: This constraint could be used to combine the and constraints to create a primary key for each table. The product ID or customer ID could serve as the primary key.

FOREIGN KEY: This constraint could be used to establish relationships between the Light & Wonder product and customer tables. For example, you could use a to link the customer ID in the customer table to the customer ID in the product table to track which products each customer has purchased.

CHECK: This constraint could be used to ensure that certain data meets specific conditions. For example, you could use a constraint to ensure that Light & Wonder product prices are always positive numbers.

DEFAULT: This constraint could be used to specify default values for certain columns. For example, you could use a constraint to set the customer registration date to the current date if no value is provided when a new customer is added to the database.

SQL Question 8: Calculating Click-through-rates for Light & Wonder

Light & Wonder, a growing digital goods company, is keen on analyzing clickthrough conversion rates from viewing a product to adding a product to the cart. The company wants to better understand which products have the highest conversion rates to improve their marketing efforts.

Given two tables, and , provide the PostgreSQL solution that calculates click-through-rates for each product, i.e., the number of times a product was added to the cart after being viewed by clicking an ad. The result should contain and .

Example Input:

product_iduser_idview_time
1011232022-07-01 10:00:00
1022562022-07-02 12:00:00
1016582022-07-02 15:00:00
1034892022-07-03 13:00:00
1019542022-07-03 18:00:00

Example Input:

product_iduser_idcart_add_time
1011232022-07-01 10:20:00
1022562022-07-02 12:30:00
1034892022-07-03 13:20:00

Answer:


This PostgreSQL solution works by joining the table with the table based on and . It then calculates the as the ratio of the times a product was added to the cart after being viewed, to the total number of times it was viewed. The result is multiplied by 100 to get a percentage. The function is used to restrict the result to two decimal places for easier interpretation.

To practice a similar SQL interview question on DataLemur's free interactive SQL code editor, solve this SQL interview question asked by Facebook:

SQL interview question asked by Facebook

SQL Question 9: Calculate Total Sales of Each Product Per Month

As an analyst in Light & Wonder, a company that sells a variety of lighting fixtures, it is your task to calculate the total sales of each product per month.

Light & Wonder has table with the following structure:

Example Input:

sale_idproduct_idsale_dateunit_soldunit_price
101P0012022-08-011020.00
102P0022022-08-12530.00
103P0012022-08-20820.00
104P0032022-09-051215.00
105P0022022-09-10630.00

You need to write a SQL query that will return a table with each row representing a product and a month, and columns for the product_id, the month of the sales, and the total sales of the product for that month.

Expected Output:

mthproducttotal_sales
08P001360.00
08P002150.00
09P003180.00
09P002180.00

Answer:


This query first extracts the month from the sale_date using the function. It then groups the sales by product and month. Within each group, it calculates the total sales by multiplying the number of units sold by the unit price and then summing up the results. Lastly, it sorts the output by month in ascending order and total sales in descending order.

Light & Wonder SQL Interview Tips

The best way to prepare for a SQL interview, besides making sure you have strong SQL fundamentals, is to practice a ton of real SQL questions that were asked in recent job interviews. Besides solving the earlier Light & Wonder SQL interview questions, you should also solve the 200+ DataLemur SQL Interview Questions which come from companies like Google, Facebook, Microsoft and Amazon.

DataLemur SQL and Data Science Interview Questions

Each problem on DataLemur has multiple hints, detailed solutions and best of all, there's an interactive SQL code editor so you can right in the browser run your query and have it graded.

To prep for the Light & Wonder SQL interview you can also be wise to solve SQL problems from other hospitality and restaurant companies like:

But if your SQL foundations are weak, forget about going right into solving questions – go learn SQL with this free SQL for Data Analytics course.

SQL interview tutorial

This tutorial covers topics including math functions like ROUND()/CEIL() and handling NULLs in SQL – both of these come up frequently during Light & Wonder SQL interviews.

Light & Wonder Data Science Interview Tips

What Do Light & Wonder Data Science Interviews Cover?

In addition to SQL query questions, the other question categories to prepare for the Light & Wonder Data Science Interview are:

Light & Wonder Data Scientist

How To Prepare for Light & Wonder Data Science Interviews?

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

  • 201 interview questions taken from Facebook, Google, & Amazon
  • a refresher covering SQL, AB Testing & ML
  • over 1000+ reviews on Amazon & 4.5-star rating

Ace the DS Interview

Also focus on the behavioral interview – prepare for that using this Behavioral Interview Guide for Data Scientists.

© 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