Get startedGet started for free

Formulating Queries (1)

You can use SQL to create or modify databases, but the focus of this open course will be on querying databases, so that you can extract data from them. A query is a request for data from a database table (or combination of tables).

To query with SQL, you firstly need the SELECT statement, which you use to specify which data that you want to get back from your query.

The data returned that is returned is stored in a result table and is called the result-set.

Since you select data from a certain database table, you use the FROM statement to list the tables that are required for the SQL statement. That’s why you’ll always see SELECT and FROM together. Without one or the other, the query won’t be able to run at all.

Sometimes, you may want to select all columns from a table. Typing out every column name would be a pain, so there's a handy shortcut:

SELECT *
FROM people;

Notice the query result tab in the bottom right corner of your screen. This is where the results of your SQL queries will be displayed.

Run the query in the editor and check out the resulting table in the query result tab!


What is the first age listed in the query result?

This exercise is part of the course

SQL Tutorial for Marketers

View Course

Exercise instructions

56,57,24,41

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

SELECT age 
FROM clients;
Edit and Run Code