Skip to Content
Getting Started with SQL
book

Getting Started with SQL

by Thomas Nield
February 2016
Beginner content levelBeginner
131 pages
2h 38m
English
O'Reilly Media, Inc.
Book available
Content preview from Getting Started with SQL

Chapter 4. SELECT

When working with databases and SQL, the most common task is to request data from one or more tables and display it. The SELECT statement accomplishes this. But the SELECT can do far more than simply retrieve and display data. As we will learn in coming chapters, we can transform this data in meaningful ways and build powerful summaries from millions of records.

But first, we will learn how to SELECT columns from a single table as well as compose expressions in them.

Retrieving Data with SQL

If you have not done so already, click on Tools→Open SQL Editor in the top menu, and make sure the rexon_metals database is open, as mentioned in the previous chapter. Your SQLiteStudio workspace should look something like Figure 4-1. Notice that the SQL workspace is now divided into two panes, a SQL Editor pane and a Query Results pane.

The SQL editor
Figure 4-1. The SQL workspace

The SQL Editor pane is where you will write your SQL, and the Query Results pane will display the results of your SQL.

Let’s write our first SQL statement. The most common SQL operation is a SELECT statement, which pulls data from a table and then displays the results. Click on the SQL Editor pane and write the following statement:

SELECT * FROM CUSTOMER;

Click the blue triangle button or hit F9 to execute the SQL.

You just ran your first query, and the results should be displayed in the bottom pane (Figure 4-2 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First SQL

Head First SQL

Lynn Beighley
SQL Fundamentals

SQL Fundamentals

Thomas Nield
Learning SQL

Learning SQL

Ben Forta

Publisher Resources

ISBN: 9781491938607Errata Page