Prologis use SQL for analyzing warehouse operational data, including shipment volumes and storage capacity, as well as optimizing inventory management systems, such as streamlining order fulfillment processes. This is why Prologis always asks SQL questions in interviews for Data Science, Analytics, and Data Engineering jobs.
To help prep you for the Prologis SQL interview, we've curated 10 Prologis SQL interview questions in this article.
Prologis is a global leader in logistics real estate with a focus on high-barrier, high-growth markets. Let's imagine a scenario where Prologis would like to identify its "VIP" tenants, i.e., tenants who lease a high amount of square footage and have been with the company for a prolonged period.
You are asked to write an SQL query which returns the top 10 tenants who have the highest total leased square footage and longest lease duration.
lease_id | tenant_id | start_date | end_date | leased_sqft |
---|---|---|---|---|
101 | 1 | 2020-01-01 | 2022-12-31 | 10000 |
102 | 2 | 2019-06-01 | 2022-06-01 | 15000 |
103 | 3 | 2020-07-01 | 2023-06-30 | 12000 |
104 | 2 | 2022-07-01 | 2025-06-30 | 20000 |
105 | 4 | 2021-01-01 | 2024-12-31 | 18000 |
tenant_id | total_leased_sqft | lease_duration |
---|---|---|
2 | 35000 | 6 |
4 | 18000 | 4 |
3 | 12000 | 3 |
1 | 10000 | 3 |
Here is an SQL statement to achieve this:
This SQL query first groups records by tenant_id and then works out the total amount of square footage leased per tenant () and the longest lease duration (). The clause then sorts the results so the tenants with the highest total square footage and longest lease duration are shown first. The clause ensures that only the top 10 results are returned.
To practice a similar customer analytics SQL question where you can solve it interactively and have your SQL solution instantly executed, try this Walmart Labs SQL Interview Question:
Assume there was a table of Prologis employee salary data. Write a SQL query to find the employees who earn more than their own manager.
employee_id | name | salary | department_id | manager_id |
---|---|---|---|---|
1 | Emma Thompson | 3800 | 1 | |
2 | Daniel Rodriguez | 2230 | 1 | 10 |
3 | Olivia Smith | 8000 | 1 | 8 |
4 | Noah Johnson | 6800 | 2 | 8 |
5 | Sophia Martinez | 1750 | 1 | 10 |
8 | William Davis | 7000 | 2 | NULL |
10 | James Anderson | 4000 | 1 | NULL |
employee_id | employee_name |
---|---|
3 | Olivia Smith |
This is the output because Olivia Smith earns $8,000, surpassing her manager, William Davis who earns 7,800.
Try this question and run your code right in DataLemur's online SQL environment:
First, we perform a SELF-JOIN where we treat the first table () as the managers' table and the second table () as the employees' table. Then we use a clause to filter the results, ensuring we only get employees whose salaries are higher than their manager's salary.
If the solution above is hard to understand, you can find a detailed solution here: Well Paid Employees.
NULLs are NOT the same as zero or blank spaces in SQL. NULLs are used to represent a missing value or the abscence of a value, whereas zero and blank space are legitimate values.
It's important to handle NULLs carefully, because they can mess up your analysis very easily. For example, if you compare a NULL value using the = operator, the result will always be NULL (because just like Drake, nothing be dared compared to NULL). That's why many data analysis in SQL start with removing NULLs using the function.
Assume Prologis, a logistics real estate company, wants to analyze the utilization of its warehouses. The data they have include daily counts of the number of parcels stored in each warehouse. They want to analyze trends across months, including the average, max, and min counts.
The relevant fields in the table include: , , and .
date | warehouse_id | parcel_count |
---|---|---|
2022-06-01 | 101 | 500 |
2022-06-02 | 101 | 520 |
2022-06-03 | 101 | 510 |
2022-06-04 | 102 | 600 |
2022-06-05 | 102 | 650 |
2022-07-01 | 101 | 520 |
2022-07-02 | 101 | 530 |
2022-07-03 | 101 | 520 |
The desired output should include the warehouse_id, month, average parcel count, max parcel count, and min parcel count.
warehouse_id | month | avg_parcels | max_parcels | min_parcels |
---|---|---|---|---|
101 | June | 510 | 520 | 500 |
102 | June | 625 | 650 | 600 |
101 | July | 523.33 | 530 | 520 |
Here, we're using window functions to calculate the average, max, and min number of parcels in each warehouse for each month. The function truncates the date to the month, effectively grouping the data by month. The clause in the window functions then isolates each warehouse and month for calculations.
For more window function practice, try this Uber SQL problem within DataLemur's interactive coding environment:
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:
Prologis is a company that specializes in real estate, particularly in the areas of industrial and logistics properties. As a candidate for a Data Analyst role at Prologis, you have been given a dataset containing information about different warehouses the company owns worldwide.
Your task is to write a SQL query that can retrieve the average size (in square feet) of the warehouses owned by Prologis in each country.
To solve this problem, you would need to calculate the average for each in the table.
warehouse_id | country | size_sq_ft |
---|---|---|
102 | USA | 50000 |
202 | UK | 75000 |
306 | Japan | 60000 |
480 | USA | 55000 |
527 | USA | 60000 |
country | average_size |
---|---|
USA | 55000 |
UK | 75000 |
Japan | 60000 |
This query groups all records by country and calculates the average size of the warehouses for each group. The AVG() function is used to get the average size in square feet for each country in the warehouses table.
To practice a very similar question try this interactive Amazon Maximize Prime Item Inventory Question which is similar for working with warehouse size data or this Wayfair Y-on-Y Growth Rate Question which is similar for < computing averages in group by categories.
Both window functions are used to find rows at a given offset from the current row. However, will give you the rows AFTER the current row you. On the other hand, will give you the rows BEFORE the current row.
Prologis is a global leader in logistics real estate with a focus on high-barrier, high-growth markets. They also have a digital marketing department that rolls out ads to get leads and conversions. As a data analyst, your job is to determine the click-through rate of user interactions with their digital ads.
You're given a table that logs each interaction a user has with a digital ad. For each interaction, it records a , , , (1 if clicked, 0 if not), and fields. There's also a table that logs whenever a click event resulted in a product interest, recording a , , , .
click_id | user_id | ad_id | ad_clicked | timestamp |
---|---|---|---|---|
1001 | 123 | 3001 | 1 | 07/25/2022 11:35:00 |
1002 | 265 | 3002 | 0 | 07/25/2022 11:40:00 |
1003 | 123 | 3001 | 0 | 07/25/2022 12:00:00 |
1004 | 362 | 3003 | 1 | 07/25/2022 12:30:00 |
1005 | 192 | 3002 | 1 | 07/25/2022 13:00:00 |
conversion_id | click_id | product_id | timestamp |
---|---|---|---|
500 | 1001 | 6001 | 07/25/2022 11:40:00 |
501 | 1004 | 6002 | 07/25/2022 12:35:00 |
502 | 1005 | 6003 | 07/25/2022 13:05:00 |
You need to write a PostgreSQL query that computes the overall click-through rate (CTR) and the conversion rate from the initial ad view to having a product interest.
This query first calculates the total number of clicks and successful clicks (i.e., ad was clicked). It then calculates the total number of successful conversions from those clicks (i.e., product interest recorded). These results are then used to calculate the click-through rate (CTR) and the conversion rate. The click-through rate is the number of successful clicks divided by the total number of ad interactions. The conversion rate is the number of successful conversions divided by the number of successful ad clicks.
To practice a similar problem about calculating rates, try this TikTok SQL question within DataLemur's online SQL coding environment:
Prologis is a company that provides logistics real estate solutions such as warehouses and distribution centers. As an analyst for Prologis, your role is to help the company understand how their properties are utilized. For this task, you are asked to write a SQL query to determine the average occupancy of each warehouse they own by month, for the year 2022.
occupancy_id | warehouse_id | date | occupancy |
---|---|---|---|
101 | 1 | 01/01/2022 | 80 |
102 | 1 | 02/01/2022 | 85 |
103 | 1 | 03/01/2022 | 90 |
104 | 2 | 01/01/2022 | 75 |
105 | 2 | 02/01/2022 | 80 |
106 | 2 | 03/01/2022 | 85 |
month | warehouse_id | avg_occupancy |
---|---|---|
1 | 1 | 80 |
1 | 2 | 75 |
2 | 1 | 85 |
2 | 2 | 80 |
3 | 1 | 90 |
3 | 2 | 85 |
In this query, we first extract the month and year from the date column, ensuring to only consider records from 2022. We then group the data by the month and warehouse_id, and calculate the average occupancy over each group. This result set will contain the average occupancy for each warehouse, per month, over the specified year.
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 Prologis's Facebook video ads that are also being run on YouTube:
The key to acing a Prologis SQL interview is to practice, practice, and then practice some more! Besides solving the earlier Prologis SQL interview questions, you should also solve the 200+ SQL coding questions which come from companies like Netflix, Google, and Amazon.
Each interview question has multiple hints, step-by-step solutions and most importantly, there's an online SQL coding environment so you can instantly run your SQL query and have it executed.
To prep for the Prologis SQL interview you can also be helpful to solve interview questions from other insurance companies like:
Stay on top of the latest news and trends in logistics and real estate with Prologis' news and press releases!
But if your SQL foundations are weak, don't worry about going right into solving questions – refresh your SQL knowledge with this DataLemur SQL tutorial.
This tutorial covers things like handling timestamps and math functions like CEIL()/FLOOR() – both of these come up often in SQL interviews at Prologis.
In addition to SQL interview questions, the other types of questions covered in the Prologis Data Science Interview are:
I believe the optimal way to prepare for Prologis Data Science interviews is to read the book Ace the Data Science Interview.
It solves 201 interview questions sourced from companies like Microsoft, Google & Amazon. The book's also got a refresher on Stats, ML, & Data Case Studies. And finally it's helped thousands of people land their dream job in data, which is why it's got over 1000+ 5-star reviews on Amazon.
While the book is more technical, it's also key to prepare for the Prologis behavioral interview. Start by reading the company's cultural values.