8 General Mills SQL Interview Questions (Updated 2024)

Updated on

October 31, 2024

Data Analysts and Data Scientists at General Mills write SQL queries to analyze production data, helping them optimize supply chain operations and reduce costs. It is also used to predict consumer trends by evaluating sales data, allowing them to tailor their products to meet market demands, which is why General Mills frequently asks jobseekers SQL interview questions.

So, to help you practice, here's 8 General Mills SQL interview questions – able to answer them all?

General Mills SQL Interview Questions

8 General Mills SQL Interview Questions

SQL Question 1: Find the power users for General Mills

General Mills is a multinational company that produces many food products. The company wants to identify its "Power Users" - i.e., customers who frequently buy its products and provide reviews. To determine this, write a SQL query that generates a list of user_id(s) who made more than 5 purchases and shared reviews more frequently over the past month.

For this scenario, let's assume we have two tables: and . The table contains information about users' purchases, while the table collects reviews made by users on the purchased products.

Example Input:

purchase_iduser_idpurchase_dateproduct_id
112307/01/2022A101
245607/02/2022A102
312307/05/2022A103
478907/07/2022A104
512307/09/2022A105
612307/12/2022A106
712307/13/2022A107

Example Input:

review_iduser_idsubmit_dateproduct_idstars
617112307/02/2022A1014
780245607/03/2022A1024
529312307/06/2022A1033
635278907/08/2022A1043
451712307/10/2022A1052
351712307/13/2022A1065
251712307/14/2022A1075

Answer:


This query first joins the and table using the and as the join keys. It only considers the data of July 2022. Then it groups the data by . The clause is then used to filter out the user_ids that have purchased more than 5 unique products and written more than 5 unique reviews, thus returning the power users for General Mills.

To practice a related customer analytics question on DataLemur's free interactive coding environment, try this Microsoft Azure Cloud SQL Interview Question:

Microsoft SQL Interview Question: Super Cloud Customer

Explore General Mills' press releases to stay updated on their latest initiatives and product innovations that are making waves in the food industry! Keeping an eye on General Mills can help you understand the trends shaping consumer preferences and food production.

SQL Question 2: Department vs. Company Salary

Suppose you had a table of General Mills employee salary data, along with which department they were in. Write a query to compare the average salary of employees in each department to the company's average salary for March 2024. Return the comparison result as 'higher', 'lower', or 'same' for each department. Display the department ID, payment month (in MM-YYYY format), and the comparison.

You can solve this interview question and run your code right in DataLemur's online SQL environment:

Department vs. Company Salary

The solution is LONG – 30+ lines of SQL. You can find a detailed solution with hints here: Department vs. Company Salary.

SQL Question 3: What are the three different normal forms?

There are several normal forms that define the rules for normalizing a database:

A database is in first normal form (1NF) if it meets the following criteria:

  • Each column in a table contains a single value (no lists or containers of data)
  • Each column should contain the same type of data (no mixing strings vs. integers)
  • Each row in the table is unique

A database is in second normal form (2NF) if it meets the following criteria:

  • It is in first normal form.
  • All non-key attributes in a table are fully dependent on the primary key.

Said another way, to achieve 2NF, besides following all the rules from 1NF all the columns in a given table should be dependent only on that table's primary key.

A database is in third normal form (3NF) if it meets the following criteria:

  • It is in second normal form.
  • There are no transitive dependencies in the table.

A transitive dependency means that a piece of data in one column is derived from another column. For example, it wouldn't make sense to keep a column called "user's age" and "user's birthdate" (because age can be derived from birthdate.

While there's also a 4th and 5th normal form, it's too pedantic and hence out-of-scope to know for the General Mills SQL interview.

General Mills SQL Interview Questions

SQL Question 4: Average Sales of Each Product On a Monthly Basis

General Mills would like to observe the performance of its products in terms of sales. Your task is to write a SQL query that outputs the average quantity of each product sold on a monthly basis. Use the PostgreSQL function to extract the month from the transaction date.

Example Input:

sale_idproduct_idtransaction_datequantity
1001502022-01-152
1002752022-01-203
1003502022-02-124
1004502022-02-226
1005752022-03-141

Example Output:

monthproduct_idavg_quantity
2022-01-01502.00
2022-01-01753.00
2022-02-01505.00
2022-03-01751.00

Answer:


In this query, we first extract the month from the transaction date using the function. Then, we calculate the average quantity of each product for each month using the function grouped by and . Finally, we order the resulting records by and .

To solve a similar window function question on DataLemur's free online SQL code editor, try this Google SQL Interview Question:

Google SQL Interview Question

SQL Question 5: What's the SQL command do, and when would you use it?

If you have two tables and want to retrieve only the rows that are present in both tables, just use the operator!

For example, let's use to find all of General Mills's Facebook video ads that are also being run on YouTube:


SQL Question 6: Analyze Product Sales and Customer Information for General Mills

General Mills is interested in analyzing its product sales in relation to customer location and preferred product categories. You are given 2 tables - and .

The table keeps a record of each product purchased by a customer, along with the purchase amount, date, and product category. The table maintains details about the customers - their id, location and registration date.

Write a SQL query to find all customers from 'New York' who have purchased products from the 'Cereal' category since '01/01/2022'.

Example Input:

purchase_idcustomer_idpurchase_dateproduct_categorypurchase_amount
120001/02/2022Cereal12.99
212301/10/2022Dairy5.99
330002/15/2022Cereal10.99
420003/01/2022Snacks2.99
512303/15/2022Cereal11.99

Example Input:

customer_idlocationregistration_date
123Los Angeles03/01/2018
200New York12/01/2019
300New York07/01/2021

Answer:


In the above PostgreSQL query, we join and tables on . Then a WHERE clause is used to filter the results for customers from 'New York' who have bought 'Cereal' products since '01/01/2022'.

SQL Question 7: What is a cross-join?

A cross-join, also known as a cartesian join, is a JOIN that produces the cross-product of two tables. In a cross-join, each row from the first table is matched with every row from the second table, resulting in a new table with a row for each possible combination of rows from the two input tables.

Let's say you were building a Machine Learning model that attempts to score the probability of a customer purchasing a General Mills product. Before working in Pandas and Tensorflow, you might want to do some Exploratory Data Analysis (EDA) in SQL, and generate all pairs of customers and General Mills products.

Here's a cross-join query you could run:


Cross-joins are useful for generating all possible combinations, but they can also create huge tables if you're not careful. For instance, if you had 10,000 potential customers and General Mills had 500 different product SKUs, the resulting cross-join would have 5 million rows!

SQL Question 8: Average Production Count from Each Facility

As a data analyst at General Mills, you are tasked with the following problem: From your database, you need to find the average number of items produced each day by each production facility. This will help the firm in optimizing production monitoring and devising ways to minimize the variability in daily output numbers.

For this task, you have access to the table that tracks every item produced in any facility. The table's schema is as follows:

Example Input:

log_idfacility_idproduction_dateitem_idcount
101106/01/2022005300
102206/01/2022007500
103106/02/2022008350
104306/02/2022002280
105206/02/2022005520

The column is a unique identifier for each log entry. dentifies each production facility. is the day when the recorded production took place. identifies the type of item produced, and is the number of such items produced on the day.

Write a SQL query to find the average daily count of each facility's production.

Answer:


This query averages the column, grouped by . As a result, it calculates the average daily production for each facility. The keyword renames the more readable column . This query is a standard use of PostgreSQL's function and clause to calculate a business-relevant metric.

To practice a very similar question try this interactive Tesla Unfinished Parts Question which is similar for needing to extract data on unfinished processes or this Alibaba Compressed Mean Question which is similar for calculating an average production metric.

Preparing For The General Mills SQL Interview

Assuming that you've already got basic SQL skills, the next best tip we have to prepare for the General Mills SQL interview is to solve as many practice SQL interview questions as you can! Beyond just solving the earlier General Mills SQL interview questions, you should also solve the 200+ DataLemur SQL Interview Questions which come from companies like Microsoft, Google, and Meta.

DataLemur SQL Interview Questions

Each exercise has multiple hints, step-by-step solutions and crucially, there's an online SQL coding environment so you can right in the browser run your SQL query answer and have it executed.

To prep for the General Mills SQL interview it is also helpful to practice interview questions from other food and facilities companies like:

But if your SQL foundations are weak, forget about diving straight into solving questions – refresh your SQL knowledge with this DataLemur SQL Tutorial.

SQL interview tutorial

This tutorial covers SQL topics like UNION vs. joins and Self-Joins – both of which come up often in General Mills SQL assessments.

General Mills Data Science Interview Tips

What Do General Mills Data Science Interviews Cover?

In addition to SQL query questions, the other question categories tested in the General Mills Data Science Interview are:

General Mills Data Scientist

How To Prepare for General Mills Data Science Interviews?

To prepare for the General Mills Data Science interview have a deep understanding of the company's values and company principles – this will be important for acing the behavioral interview. For the technical Data Science interviews, get ready by reading Ace the Data Science Interview. The book's got:

  • 201 Interview Questions from Google, Microsoft & tech startups
  • A Crash Course on SQL, Product-Sense & ML
  • Amazing Reviews (1000+ 5-star reviews on Amazon)

Ace the Data Science Interview by Nick Singh Kevin Huo

© 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 Analysts