SQL SELECT

Read data from a table.

✍️ 3 exercises + code challenge in this lesson

The SELECT statement retrieves data from a table. The result is called a result set.

  • SELECT column1, column2 FROM table;: chosen columns.
  • SELECT * FROM table;: every column.

You can also select calculated values: SELECT ProductName, Price * 1.18 FROM Products;

The editor loads a sample shop database with the tables Customers, Products, Orders and OrderItems before every run, so you can query them straight away.

Key Takeaways: SQL SELECT

Mastering SQL SELECT helps you write clean and reliable SQL code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.

SQL SELECT Code Example

SQL
SELECT CustomerName, City, Country
FROM Customers;
Free sign-in required · Google login available

SQL SELECT Practice Exercises

Check what you learned in “SQL SELECT”.

/ 3 solved
Fill in the blank

Select the ProductName and Price columns.

SELECT , Price FROM Products;
✓ Correct! Not quite. Try again.
Multiple choice

What is the result of a SELECT called?

✓ Correct! Not quite. Try again.
Code challenge

Select the City column from Customers.

Write the code in the live editor. Your answer is checked automatically.

Free sign-in required · Google login available

to save your exercise progress.
Finished this lesson?
Mark it complete to track your progress.

Stuck on something?

Ask the community in the CodesInTech forum.

Need a developer?

Learning on your own is great — and when you need professional help, our team builds custom software, websites and mobile apps for clients worldwide.

Explore Our Services