Skip to Main Content
Learn SQL using MySQL in One Day and Learn It Well
book

Learn SQL using MySQL in One Day and Learn It Well

by Jamie Chan
April 2024
Intermediate to advanced content levelIntermediate to advanced
127 pages
2h 29m
English
Packt Publishing
Content preview from Learn SQL using MySQL in One Day and Learn It Well

Chapter 5: Selecting Data Part 1

 

In this chapter, we’ll learn to select data from our database. This is a relatively large topic, so we’ll be splitting it into three chapters.

 

The data used for selection are from the two tables (employees and mentorships) that we created in the previous chapters. These tables can be found in Appendix A for easy reference.

 

In the first chapter, we’ll learn to select data from a single table.

 

Basic Select Syntax

 

To select data from a single table, we use the syntax

 

SELECT column_names_or_other_information

[AS alias]

[ORDER BY column(s)] [DESC]

FROM table_name

[WHERE condition];

 

Let’s look at some examples.

 

Selecting Everything

 

If we want to select all the columns and rows from a table, we ...

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

MySQL Crash Course

MySQL Crash Course

Rick Silva

Publisher Resources

ISBN: 9781836205678Supplemental Content