Your Cart
Loading

Real SQL questions

On Sale
$4.00
$4.00
Added to cart

Basic SQL Questions

  1. Write a query to select all columns from a table Employees where salary > 50000.
  2. Write a query to find the second highest salary in the Employees table.
  3. Write a query to count the number of employees in each department.
  4. Write a query to find employees whose name starts with 'A'.
  5. Write a query to update the salary of all employees in department 10 by 10%.

Intermediate SQL Questions

  1. Write a query to find employees who do not have a manager.
  2. Write a query to find the top 3 highest paid employees in each department.
  3. Write a query to delete duplicate rows from a table but keep one copy.
  4. Write a query to find employees who joined in the last 3 months.
  5. Write a query to get the total salary for each department, including departments with no employees.

Advanced SQL Questions

  1. Write a query to find employees whose salary is above the average salary of their department.
  2. Write a query to pivot data, showing total sales for each product per month.
  3. Write a query to find the department with the highest number of employees.
  4. Write a query to identify gaps in a sequence of IDs in a table.
  5. Write a query to find employees who earn more than their manager.

Scenario-Based / Real-Life SQL

  1. You have a Sales table with OrderID, CustomerID, OrderDate, Amount. Write a query to get total monthly sales for the last year.
  2. You have Users and Orders tables. Write a query to find users who haven’t placed any orders.
  3. You have Products and Inventory tables. Write a query to find products that are out of stock.
  4. You have Transactions table. Write a query to find suspicious transactions above $10,000.
  5. Write a query to merge two tables (upsert) in SQL.


You will get a PDF (4MB) file

Customer Reviews

There are no reviews yet.