SQL Basic Question for interview
December 21, 2024

SQL Basic Question for interview

Let’s get down to business.

I created a Great SQL Interview GitHub repository for preparing interview questions and practicing SQL queries. I divide SQL queries into three parts: Basic (L0), Intermediate (L1) and Advanced (L2). This is the basic part of the solution.



L0: Basic SQL

  • Questions related to basic SQL commands such as SELECT, INSERT, UPDATEand DELETE.
  • Queries related to basic data manipulation and simple table retrieval.


Query question:

  1. How to display all columns and rows customers table?
  2. Write a query to retrieve only customerName and phone from customers table.
  3. How to list all rows country It’s “America” customers table?
  4. Write a query to find all products products table with a buyPrice Less than 50.
  5. How to get all orders status “shipped” from orders table?
  6. Write a query to display productName and quantityInStock for all products products table.
  7. How do you find something different? country value in customers table?
  8. Write a query to count the total number of customers customers table.
  9. How to retrieve all employees jobTitle Is it a “sales representative”?
  10. Write a query to sort products Table basis productName Sort in ascending order.
  11. how do you get customerName and city How many of all customers are located in “Paris”?
  12. Write a query to display the first 10 orders orders table based on orderDate.
  13. How to search all offices Located in the United States?
  14. Write a query to display all employees who work in the “San Francisco” office.
  15. How to calculate order total orders table?
  16. Write a query to display productName of all products products where is the table productLine It’s a “classic car.”
  17. how do you find customerName of all customers creditLimit Greater than 50,000?
  18. Write a query to get all the files that have quantityInStock Between 10 and 100.
  19. How can I retrieve all orders placed in 2003?
  20. Write a query to display employeeNumber and firstName Employees whose last names begin with “B”.


Solutions and explanations

  1. How to display all columns and rows customers table?

  2. Write a query to retrieve only customerName and phone from customers table.

  3. How do I list all rows in the Customers table where the country is “United States”?

  4. Write a query to find all products products table with a buyPrice Less than 50.

  5. Get all orders status “shipped” from orders table.

  6. show productName and quantityInStock for all products products table.

  7. find something different country value in customers table.

  8. Count the total number of customers in the store customers table.

  9. Retrieve all employees jobTitle Is it a “sales representative”?

  10. sort products Table basis productName Sort in ascending order.

  11. Get customerName and city All customers located in Paris.

  12. Show first 10 orders orders table based on orderDate.

  13. Search all offices Located in the United States.

  14. Displays all employees working in offices located in San Francisco.

  15. Calculate the total number of orders orders table.

  16. show productName of all products products where is the table productLine It’s a “classic car.”

  17. turn up customerName of all customers creditLimit Greater than 50,000.

  18. Get all files that have quantityInStock Between 10 and 100.

  19. Retrieve all orders placed in 2003?

  20. show employeeNumber and firstName Employees whose last names begin with “B”.


Hey my name is Jaimin Baria aka Cloud Boy…, if you liked and learned something useful like this post please add a comment and visit my Great SQL Interview GitHub repository.

Don’t forget to get started😅.

Happy coding 🧑‍💻

2024-12-21 10:24:05

Leave a Reply

Your email address will not be published. Required fields are marked *