Write a query to identify the employee(s) whose salary is closest to the average salary of the company.

This question was asked in Interview at black rock. The open position had a CTC of 26 LPA. Read more Company: BlackRock CTC: 26LPA Source: LinkedIn SQL Interview Question Q. Write a query to identify the employee(s) whose salary is closest to the average salary of the company see this code on db-fiddle Solution Explanation In this … Read more

Display all months where sales exceeded the average monthly sales.

Display all months where sales exceeded the average monthly sales

This question was asked in Interview at black rock. Read more Company: BlackRock CTC: 26LPA Source: LinkedIn SQL Interview Question Q. Display all months where sales exceeded the average monthly sales see this code on db-fiddle Solution Solution 1 Solution 2 Explanation Although there are multiple ways to solve this problem, using the CTE method stands out … Read more

Find the most common value (mode) in a specific column.

Find the most common value (mode) in a specific column

This question was asked in Interview at black rock. Read more Company: BlackRock CTC: 26LPA Source: LinkedIn SQL Interview Question Q. Find the most common value (mode) in a specific column. See this code on db-fiddle Solution Explanation We have selected ProductName along with the count of rows as Frequency, grouping the data by ProductName. To display … Read more

Write a query to retrieve the first order placed by each customer.

Write a query to retrieve the first order placed by each customer.

This question was asked in Interview at black rock. Read more Company: BlackRock CTC: 26LPA Source: LinkedIn SQL Interview Question Q. Write a query to retrieve the first order placed by each customer. see this code on db-fiddle Solution Solution 1 Solution 2 Solution 3 Explanation While there are multiple ways to solve this problem, but most … Read more

Display the cumulative percentage of total sales for each product.

Display the cumulative percentage of total sales for each product.

This question was asked in Interview at black rock. Read more Company: BlackRock CTC: 26LPA Source: LinkedIn SQL Interview Question Q. Display the cumulative percentage of total sales for each product. sale_id product_id sales 1 101 500.00 2 102 300.00 3 103 200.00 4 101 400.00 5 102 600.00 6 103 800.00 7 104 1000.00 … Read more