Home > Articles > Data > SQL

  • Print
  • + Share This
This chapter is from the book

Retrieving Individual Columns

We’ll start with a simple SQL SELECT statement, as follows:

Input icon.jpg

SELECT prod_name
FROM Products;

Analysis icon.jpg

The previous statement uses the SELECT statement to retrieve a single column called prod_name from the Products table. The desired column name is specified right after the SELECT keyword, and the FROM keyword specifies the name of the table from which to retrieve the data. The output from this statement is shown in the following:

Output icon.jpg

Fish bean bag toy
Bird bean bag toy
Rabbit bean bag toy
8 inch teddy bear
12 inch teddy bear
18 inch teddy bear
Raggedy Ann
King doll
Queen doll

A simple SELECT statement similar to the one used above returns all the rows in a table. Data is not filtered (so as to retrieve a subset of the results), nor is it sorted. We’ll discuss these topics in the next few lessons.

  • + Share This
  • 🔖 Save To Your Account