An Introduction to SQL

SQL stands for Structured Query Language, this is a programming language that allows the user to access and manage databases through writing commands to retrieve, modify, insert, and delete data. SQL is used across many technologies, and is widely recognised language! This blog will introduce the main concepts of reading and understanding SQL.

Coding SQL Query in a PHP file using Atom; my favourite editor to work on web projects
Photo by Caspar Camille Rubin / Unsplash

Queries are the commands from the user to communicate with the database.

The order of query statements are:

  1. Select - to retrieve data
  2. From - specifying where the data is coming from
  3. Where - to filter the results on a specific condition
  4. Group By - a summation of rows, for instance to use AVG(), COUNT(), SUM(), MAX(), MIN().
  5. Having - to filter based on the conditions applied to the aggregation of Group By.
  6. Order By - to arrange the output in desc or asc order

Example: the query below will select on everything from the Orders table within the TIL_PLAYGROUND.SQL_COURSE database.

Select Query in SQL

Example: the query below will select on everything from the Orders table within the TIL_PLAYGROUND.SQL_COURSE database and only give back 50 rows.

Example: the query below will select on everything from the Orders table within the TIL_PLAYGROUND.SQL_COURSE database and then join this to the Customers table, this is on the join clause that customer ID = customer ID from the respective tables.

Example: the query below will select the columns product_ID and ship_mode from the Orders table within the TIL_PLAYGROUND.SQL_COURSE database however it will filter the rows to only ones that have sales inclusive of 50 to 100 as well as only Second Class ship modes.

I hope that has aided your understanding of some simple concepts of SQL! and I will be back with another blog of more advanced concepts later this week.

~ Numa

Author:
Numa Begum
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab