At Autodesk, SQL is used quite frequently for analyzing user behavior of it's construction software products and to support it's construction cloud analytics product. That's why Autodesk asks SQL query questions in interviews for Data Science, Data Engineering and Data Analytics jobs.
In case you're studying for a SQL Assessment, we've curated 11 Autodesk SQL interview questions to practice, which are similar to commonly asked questions at Autodesk – how many can you solve?
Autodesk provides suites of software services for professionals in construction, manufacturing, media, and other sectors. An important business metric for Autodesk is the amount and frequency of product usage by its users. Let's consider we have a log table that records every single usage of Autodesk products including the time the user used the product, and which user used which product.
In this context, let's define Autodesk Whale Users as users who use any Autodesk product more than 500 times in a month.
Can you write a SQL query to identify Autodesk Whale Users for the month of September 2022?
This query seeks to count the frequency of usage per user for the month of September 2022 by using the DATE_PART function to filter for that specific month and year, and then grouping by user_id. We use the HAVING clause to only return users with a usage_count greater than 500, which are the Whale Users.
To practice a similar SQL problem on DataLemur's free online SQL code editor, attempt this Facebook SQL Interview question:
At Autodesk, we have multiple software products and it's vital to measure user satisfaction. A unique review is submitted by a user for a product each month, identified by a user_id, product_id, submit_date and rating out of 5 stars. In this question, you're to write a SQL query that calculates the average rating (stars) of each product for each month. Assume that the submit_date is in the 'YYYY-MM-DD HH:MI:SS' format.
review_id | user_id | submit_date | product_id | stars |
---|---|---|---|---|
6171 | 123 | 2021-06-08 00:00:00 | 50001 | 4 |
7802 | 265 | 2021-06-10 00:00:00 | 69852 | 4 |
5293 | 362 | 2021-06-18 00:00:00 | 50001 | 3 |
6352 | 192 | 2021-07-26 00:00:00 | 69852 | 3 |
4517 | 981 | 2021-07-05 00:00:00 | 69852 | 2 |
month | product_id | average_rating |
---|---|---|
6 | 50001 | 3.50 |
6 | 69852 | 4.00 |
7 | 69852 | 2.50 |
This query first extracts the month part from the submit_date field. Then, it calculates the average rating per month and product_id using the AVG function. Finally, it orders the result by month and product_id.
To practice another question about calculating rates, try this SQL interview question from TikTok on DataLemur's interactive coding environment:
The primary key of a table is a column or set of columns that serves as a unique identifier for each row. It ensures that all rows are distinct and does not allow null values.
For example, say you had stored some Facebook ad campaign data that Autodesk ran:
The CampaignID column is used to uniquely identify each row in the table, and the constraint ensures that there are no duplicate CampaignID values. This helps to maintain the accuracy of the data by preventing duplicate rows. The primary key is also an important part of the table because it enables you to easily identify and reference specific campaigns in your Facebook Ad data. You can use it to join to other tables in the database, such as a table with data on the results of the campaigns.
Autodesk, Inc. is a multinational software company that makes software services for the architecture, engineering, construction, manufacturing, media, education, and entertainment industries. Autodesk produces a wide range of products that facilitate the professional work of its customers, their tools range from AutoCAD to Maya, a render software for 3D animations.
Let's consider a business scenario where Autodesk wants to analyze the usage of its software products in client companies. They intend to observe the number of licenses active, the number of users per client company, and the overall usage duration of each software product. Given the daily usage data, design a database schema to model this situation and write a SQL query to get total usage in hours, per client company, per product for the month of July 2022.
Here are some sample tables with inputs and expected outputs.
product_id | product_name |
---|---|
1 | AutoCAD |
2 | Maya |
3 | 3ds Max |
client_id | client_name |
---|---|
1 | CompanyA |
2 | CompanyB |
3 | CompanyC |
client_id | product_id | user_id | usage_date | usage_hours |
---|---|---|---|---|
1 | 1 | 1001 | 07/01/2022 | 8 |
2 | 2 | 2001 | 07/10/2022 | 5 |
1 | 3 | 1002 | 07/20/2022 | 6 |
3 | 1 | 3001 | 07/30/2022 | 7 |
1 | 1 | 1003 | 07/31/2022 | 4 |
client_name | product_name | total_usage_hours |
---|---|---|
CompanyA | AutoCAD | 12 |
CompanyB | Maya | 5 |
CompanyA | 3ds Max | 6 |
CompanyC | AutoCAD | 7 |
In PostgreSQL the query can be formulated as follows:
This SQL query joins all three tables and sums the usage_hours grouping by client_name and product_name. The WHERE condition limits the calculation to the usage data of July 2022. The sorting order presents the results such that the company with the most usage hours comes first for each specific product.
To practice a similar SQL interview question on DataLemur's free interactive SQL code editor, solve this SQL interview question asked by Facebook:
When designing a database schema, a one-to-one relationship between two entities is characterized by each entity being related to a single instance of the other. An example of this is the relationship between a car and a license plate - each car has one license plate, and each license plate belongs to one car.
On the other hand, a one-to-many relationship is when one entity can be associated with multiple instances of the other entity. For example, a person can have multiple email addresses, but each email address only relates back to one person.
Assuming for Autodesk, you are given a table with information on Autodesk's customers and a table which records all the purchases made by these customers.
Currently, Autodesk wants to filter out list of customers who are from 'USA' and have made more than $5000 worth of purchases in 'AutoCAD' product. Write a SQL query to generate this list.
customer_id | first_name | last_name | country |
---|---|---|---|
1 | John | Doe | USA |
2 | Ann | Smith | UK |
3 | Tim | Jones | USA |
4 | Amy | Brown | Canada |
purchase_id | customer_id | product_name | amount |
---|---|---|---|
1 | 1 | AutoCAD | 5000 |
2 | 2 | Revit | 2000 |
3 | 3 | AutoCAD | 6000 |
4 | 1 | Revit | 3000 |
5 | 2 | AutoCAD | 500 |
6 | 3 | AutoCAD | 4000 |
This query first joins the and tables on . It then selects customers from 'USA' and their total purchases in 'AutoCAD'. Finally, it filters the results for customers whose total purchases exceed $5000.
To practice another question about calculating rates, try this TikTok SQL Interview Question within DataLemur's interactive coding environment:
The keyword added to a statement can be used to get records without duplicates.
For example, say you had a table of Autodesk customers:
name | city |
---|---|
Akash | SF |
Brittany | NYC |
Carlos | NYC |
Diego | Seattle |
Eva | SF |
Faye | Seattle |
Suppose you wanted to figure out which cities the customers lived in, but didn't want duplicate results, you could write a query like this:
Your result would be:
city |
---|
SF |
NYC |
Seattle |
As an analyst at Autodesk, you need to understand the average duration of usage for their AutoCAD software. This could help help benefit the business strategy for understanding user interaction with the software. Write a SQL query that calculates the average duration of usage per user for AutoCAD.
Autodesk operates a logging system which logs any user's interaction with the software. A sample of logged data is provided in the table below.
log_id | user_id | start_time | end_time | software_name |
---|---|---|---|---|
1 | 12 | 06/08/2022 09:00:00 | 06/08/2022 11:00:00 | AutoCAD |
2 | 15 | 06/08/2022 10:00:00 | 06/08/2022 12:00:00 | Revit |
3 | 12 | 06/09/2022 10:30:00 | 06/09/2022 11:30:00 | AutoCAD |
4 | 18 | 06/10/2022 14:00:00 | 06/10/2022 16:30:00 | AutoCAD |
5 | 15 | 06/10/2022 15:00:00 | 06/10/2022 17:00:00 | AutoCAD |
This SQL query selects the user_id and calculates the average difference (in hours) between the start_time and end_time for each user where the software_name is AutoCAD. The gives the difference in seconds between the two times, which is then divided by 3600 to convert it to hours. The CSV function then calculates the average duration for each user. The result is a list of users and their average usage duration for the AutoCAD software.
To practice a similar SQL problem on DataLemur's free interactive SQL code editor, attempt this Meta SQL interview question:
Given a list of Autodesk software usage by various users over different months, calculate the average usage hours per software per month.
usage_id | user_id | month_year | product_id | usage_hours |
---|---|---|---|---|
1001 | 234 | 05/2022 | AutoCAD | 30 |
1002 | 567 | 05/2022 | AutoCAD | 45 |
1003 | 234 | 05/2022 | Maya | 20 |
1004 | 891 | 06/2022 | 3ds Max | 50 |
1005 | 567 | 06/2022 | AutoCAD | 32 |
1006 | 234 | 06/2022 | AutoCAD | 35 |
month_year | product_id | avg_usage_hours |
---|---|---|
05/2022 | AutoCAD | 37.50 |
05/2022 | Maya | 20.00 |
06/2022 | 3ds Max | 50.00 |
06/2022 | AutoCAD | 33.50 |
This query uses the GROUP BY statement with AVG function to find the average usage_hours for each product_id per month_year. The result is ordered by month_year and product_id for easier reading.
To solve another question about calculating rates, solve this TikTok SQL question within DataLemur's online SQL coding environment:
Stored procedures are a lot like functions in programming. They're used to encapsulate and organize business logic into one unit of code, and they can accept multiple input parameters and return multiple output values.
For example, if you were a Data Analyst at Autodesk working on a HR analytics project, you might create a stored procedure to calculate the average salary for a given department:
To call this stored procedure and find the average salary for the Data Analytics department you'd write the following query:
At Autodesk, we are continuously releasing new versions of our software products and we would like to identify the best versions based on user reviews. Each product has a different number of reviews, and each review has a number of stars and a weight, where the weight implies the importance of the review based on the reviewer's profile.
We want to calculate a weighted rating for each product version using the following formula:
where:
Create a SQL query that calculates the weighted rating for each product version.
review_id | product_version | stars | weight |
---|---|---|---|
1 | A.1 | 4 | 0.8 |
2 | A.1 | 5 | 1.0 |
3 | B.1 | 3 | 0.5 |
4 | B.1 | 3 | 1.0 |
5 | A.2 | 4 | 0.6 |
6 | A.2 | 5 | 0.6 |
7 | A.2 | 5 | 1.0 |
8 | B.2 | 2 | 0.8 |
9 | B.2 | 2 | 0.8 |
10 | B.2 | 3 | 1.0 |
The first CTE calculates the number of reviewers, the average number of stars, and the weighted average stars for each product version. The second CTE calculates the mean review score across the all reviews. The final SELECT statement applies the formula to return a list of product versions and their corresponding weighted ratings, sorted in descending order of the weighted rating.
To solve a similar problem on DataLemur's free online SQL coding environment, attempt this Facebook SQL Interview question:
The key to acing a Autodesk SQL interview is to practice, practice, and then practice some more! Beyond just solving the above Autodesk SQL interview questions, you should also solve the 200+ SQL questions on DataLemur which come from companies like Microsoft, Google, and Facebook.
Each interview question has hints to guide you, step-by-step solutions and best of all, there's an interactive coding environment so you can instantly run your SQL query and have it checked.
To prep for the Autodesk SQL interview it is also useful to practice SQL questions from other tech companies like:
But if your SQL query skills are weak, forget about going right into solving questions – improve your SQL foundations with this SQL tutorial for Data Scientists & Analysts.
This tutorial covers topics including joining a table to itself and finding NULLs – both of which show up routinely in Autodesk SQL assesments.
For the Autodesk Data Science Interview, beyond writing SQL queries, the other types of questions which are covered:
To prepare for Autodesk Data Science interviews read the book Ace the Data Science Interview because it's got: