Data warehousing Code Challenges & Tips topic image left

Data warehousing Code Challenges & Tips

  • 10 Topics

Share on:
    Linked IN Icon Twitter Icon FB Icon
Data warehousing Code Challenges & Tips topic image right



1. Write a SQL query to find the top 3 customers with the highest total purchase amount from a sales table.

2. Create a SQL query to obtain the daily sales total for each product in a specified date range from a sales table, ordered by date.

3. Write a SQL statement to calculate the percentage growth in sales for each product month-over-month.

4. Given a table called `employees` with columns `employee_id`, `manager_id`, and `salary`, write a query to find the average salary of employees who report directly to each manager.

5. Write a SQL query to fetch the customers who have made more than 5 purchases and whose total spending exceeds $10,000, using a `GROUP BY` clause.

6. Create a SQL statement to calculate the running total of sales amounts per day in a sales table.

7. Write a SQL query to pivot sales data from a table into a format where each product type is a column and the values represent the total sales for that product type.

8. Write a SQL expression to determine the highest sales quarter for each product in the sales table, assuming the sales data spans multiple years.

9. Given a data warehouse star schema with a `fact_sales` table and `dim_date`, `dim_products`, and `dim_customers` dimensions, write a query to join these tables and return the total sales amount by year and by product.

10. Create a SQL query that implements a CTE (Common Table Expression) to find the percentage of total sales that each product contributes, ranked in descending order.



Reveal all the approved answers to the questions above and explore all the types of Data warehousing questions and answers.

Explore Now

Share on:
    Linked IN Icon Twitter Icon FB Icon