Recent posts

Find the top 5 most expensive items in the database.
AskAI SQL Problems

To find the top 5 most expensive items in the database, write a SQL query that orders the items by price in descending order.

134
Nov 23
3rd Highest Salary in a Table
AskAI SQL Problems

To find the third highest salary in a table, you can use a SQL query. For example, given the following table: | ID | Name | Salary | |---- |-------|--------| | 1 | John | 1000 | | 2 | Jane | 2000 | | 3 | Joe | 3000 | | 4 | Sarah | 4000 | | 5 | Dave | 5000 | The third highest salary would be Joe's, with a salary of 3000.

152
Nov 23
Average Employee Salary by Department
AskAI SQL Problems

This technical problem involves writing a SQL query to find the average salary of employees by department. The example input table includes columns for department, first name, last name, and salary. The expected output is a table with columns for department and average salary.

158
Nov 23
SQL Query to Find Products That Have Been in Stock for More Than 365 Days
AskAI SQL Problems

Write a SQL query to find the products that have been in stock for more than 365 days.

156
Nov 23
Get the average price of all products in an unnormalized database table.
AskAI SQL Problems

The problem is to write a query to return the average price of all products in an unnormalized database table. The table includes the attributes productID, productName, productDescription, and productPrice.

154
Nov 23
Find all employees who work in the Sales department.
AskAI SQL Problems

Given a database with two tables, Employees and Departments, this SQL query will find the names of all employees who work in the Sales department.

159
Nov 22
Designing a Social Network Database Schema
AskAI SQL Problems

This technical problem deals with designing a social network database schema that includes posts, comments, and likes. The input is a set of CREATE TABLE statements for the three tables, and the output is sample data for those tables.

236
Nov 22
Find customer with highest balance
AskAI SQL Problems

To find the customer with the highest balance, you can use a simple SQL query as follows: SELECT customer_id, name, balance FROM customers ORDER BY balance DESC LIMIT 1

156
Nov 22