Oracle NextGen
score
SQL Challenges
Practice your SQL skills with our collection of challenges
Filter by difficulty:
All
Easy
Medium
Hard
Challenge #1 – Select All Products
Retrieve all products from the products table. This is a basic SELECT query to get familiar with querying data.
Easy
Start Challenge
Challenge #2 – Count Employees
Count the total number of employees in the company.
Easy
Start Challenge
Challenge #3 – Filter by Price
Find all products that cost less than $100.
Easy
Start Challenge
Challenge #4 – Find Specific Customer
Retrieve customer information for customers whose email ends with '@gmail.com'.
Easy
Start Challenge
Challenge #5 – Average Salary by Department
Calculate the average salary for each department.
Easy
Start Challenge
Challenge #6 – Top Scoring Students
Report the students who scored 90 or above in the most recent algorithm exam. Provide their identifiers, names, and scores ranked from highest to lowest.
Medium
Start Challenge
Challenge #7 – Customer Orders Summary
Find customers who have placed more than 2 orders and show their total spending.
Medium
Start Challenge
Challenge #8 – Product Categories Revenue
Calculate total revenue for each product category and show only categories with revenue over $500.
Medium
Start Challenge
Challenge #9 – Employee Managers
List all employees along with their manager's name. Show employees who have a manager.
Medium
Start Challenge
Challenge #10 – Monthly Sales Trend
Calculate total sales for each month in 2024 and show the month name and total.
Medium
Start Challenge
Challenge #11 – Consecutive Login Streak
Find users who have logged in for at least 3 consecutive days and show their longest streak.
Hard
Start Challenge
Challenge #12 – Second Highest Salary
Find the second highest salary in each department. If a department has only one employee, return NULL.
Hard
Start Challenge
Challenge #13 – Customer Retention Rate
Calculate the month-over-month retention rate: the percentage of customers who made purchases in both the current and previous month.
Hard
Start Challenge
Challenge #14 – Product Recommendation Pairs
Find pairs of products that are frequently bought together (in the same order). Show pairs that appear in at least 2 orders.
Hard
Start Challenge
Challenge #15 – Running Total with Reset
Calculate a running total of daily sales for each product category, but reset the total when it exceeds $1000.
Hard
Start Challenge