🔥 $100K Hit! Where Will Bitcoin Go Next? Find Out Live!

Code has been added to clipboard!

SQL SELECT and SELECT ALL Statements

Reading time 1 min
Published Jan 4, 2016
Updated Oct 9, 2019

TL;DR – The SQL SELECT command is commonly used for search queries. Using it, you can select specific data from your SQL databases. The data you select is stored in a table called a result-set.

Syntax of SQL SELECT

Selecting specific columns

Example
SELECT column1, column2, ...
FROM table_name;

Selecting all columns

Example
SELECT * FROM table_name;
DataCamp
Pros
  • Easy to use with a learn-by-doing approach
  • Offers quality content
  • Gamified in-browser coding experience
  • The price matches the quality
  • Suitable for learners ranging from beginner to advanced
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid Certificates of completion
edX
Pros
  • A wide range of learning programs
  • University-level courses
  • Easy to navigate
  • Verified certificates
  • Free learning track available
Main Features
  • University-level courses
  • Suitable for enterprises
  • Verified certificates of completion

Examples using a demo database

The Users table

ID Username Email Password
1 alfredfutter [email protected] secret1
2 atrujillo [email protected] secret2
3 moreno.antonio [email protected] secret3
4 hardythomas [email protected] secret4
5 bergluns [email protected] secret5

Using SELECT to retrieve data of specific columns

Example
SELECT username,email 
FROM users;

Using SELECT to retrieve data of all columns

Example
SELECT * FROM users;

Note: SELECT * selects all columns, SELECT ALL selects all rows.