OMG SQL...

So... you want to know the basics to SQL? Well, you have come to the right place.

Ultimately, there are 6 key categories; Select; From; Where; Group By; Having; and Order By.

Each performs a different function and allows the user to return more detailed queries from their data source.

If you are more familiar with Alteryx then this may be an easier way to visualise what each does.

Select: allows us to select the specific data one requires from the data source

From: follows a specific file path whereby the data will be retrieved from

Where: matches the  data you have asked for in the select function and draws the column headers for that data

Group By: allows the user to aggregate the data which has been matched in the where function

Having: similarly to the where function,  filters the data on an aggregated level

Order By: sorts the data, either in an ascending or descending order

Examples:

The following query asks to return each city which contains 'town' within them.

This returns any unprofitable within either the state of Illinois and the East side of North America:

Happy SQL'ing!!

Author:
Ben Winsey
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