Recent posts

Summing Values in a Table
AskAI SQL Problems

To find the sum of all values in a table with two columns, "id" and "value", use the following query: SELECT SUM(value) FROM table

109
Nov 27
Find the products with the highest price per unit.
AskAI SQL Problems

Given a table of products and their prices, write a SQL query to find the products with the highest price per unit.

157
Nov 26
Get total number of employees in each department
AskAI SQL Problems

Write a stored procedure that returns the total number of employees in each department from a given table of employee data.

136
Nov 26
Find all rows where parent_id is not equal to child_id
AskAI SQL Problems

Given a table with three columns: id, parent_id, and child_id, write a SQL query to find all the rows where the parent_id is not equal to the child _id.

150
Nov 26
Find the average order value for each customer.
AskAI SQL Problems

This technical problem asks the reader to write a SQL query to find the average order value for each customer, given a table of customer orders. An example input and output is provided.

183
Nov 26
Find the Second Highest Salary in an Employees Table
AskAI SQL Problems

This technical problem asks the reader to write a SQL query to find the second highest salary from a given table of employees. An example table is provided, along with the expected output.

167
Nov 26
Find names of people with score > 80
AskAI SQL Problems

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

157
Nov 26
Update total department salary on employee salary update
AskAI SQL Problems

Write a trigger that will update the total salary for each department when an employee's salary is updated.

182
Nov 26