Skip to Main Content
The SQL Workshop
book

The SQL Workshop

by Frank Solomon, Rakesh Kumar Pandey, Shubham Jain, Prashanth Jayaram, Awni Al Saqqa, Fiodar Sazanavets, Aaditya Pokkunuri, Shashikant Shakya, Dixit Patel, Pradeep Kumar Gupta, Scott Cosentino
December 2019
Beginner content levelBeginner
288 pages
4h 48m
English
Packt Publishing
Content preview from The SQL Workshop

4. The SELECT Statement

Overview

This chapter illustrates how to query data from a database, and how we can order them. By the end of this chapter, you will be able to select a specific number of columns, order and sort results, use naming aliases with the AS clause, filter your search results using the LIMIT and DISTINCT keywords, and combine and use SELECT with mathematical operations.

Introduction

So far, whenever we have wanted to see the results, we have used the Select * syntax either by entering that query directly, or by generating it using the appropriate option in the application's menu. This displayed the entire table. However, when we want to retrieve data from the database, we are often not interested in the entire dataset; ...

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

SQL for Business Users

SQL for Business Users

O'Reilly Media, Inc.
SQL Antipatterns

SQL Antipatterns

Bill Karwin

Publisher Resources

ISBN: 9781838642358Supplemental Content