Read Table

Now you will learn how to read data from a table: not just all of it, but only what you need, in the shape you want.

Sometimes you want all columns. Other times, maybe just names. Or maybe only employees older than 30. You might want just the top 3 records, or names that start with 'A'. SQL lets you shape your results in all these ways.

Topic: Read Table

Let's start with the simplest way to read data, using the SELECT statement.

Basic Query

SELECT * FROM employees;

This returns all columns and all rows from the employees table.


But what if we only want some columns?

SELECT name, age FROM employees;

This returns just the name and age columns for every row.


As you go forward, you will learn how to filter, sort and summarize your results, so you only get what is useful to you.

In the exercise, read three columns in the order the task asks for.