Sql Queries

SQL Query to Find Common Records Between Two Tables
AskAI

This technical problem deals with finding common records between two SQL tables. An example is given, along with the expected output.

246
Jan 31
SQL Query to Find Top 10 Customers by Total Spend
AskAI

This technical problem asks the reader to write a SQL query to find the top 10 customers by total spend. The table of customer data is provided as an example, and the expected output is also provided.

261
Jan 31
Find names of people with score > 80
AskAI

Write a SQL query that returns the names of all the people who have a score greater than 80.

221
Nov 26
Find All Customers Who Have Ordered a Product That Is Out of Stock
AskAI

This technical problem involves finding all customers who have ordered a product that is out of stock. The input is three tables: customers, orders, and products. The output is the customers table with the id and name of the customers who have ordered a product that is out of stock.

239
Nov 25
SQL Query to Find Total Number of Orders per Customer
AskAI

To find the total number of orders for each customer, you can use a SQL query as follows: SELECT customer_id, COUNT(order_id) AS total_orders FROM customer_orders GROUP BY customer_id;

237
Nov 18
Find Employees Who Make More Than Average Salary
AskAI

This technical problem involves writing a SQL query to find employees who make more than the average salary.

239
Nov 13
SQL Query to Find Number of Employees in Each Department
AskAI

This technical problem involves writing a SQL query to find the number of employees in each department. The table of data provided in the example input includes department and employee count columns. The desired output is also provided in the example, and includes the same department and employee count columns.

181
Nov 12
Find the customer with the highest total purchase amount
AskAI

To find the customer with the highest total purchase amount, write a SQL query that select the customer with the maximum TotalPurchaseAmount from the table.

219
Nov 10