Introduction to SQL

Many occupations rely on SQL for data retrieval and management. Since SQL is robust and easy to learn, some job portals consider it the most in-demand skill an employee can have. Here is a quick introduction to SQL.

What is SQL?

Structured Query Language, abbreviated as SQL, is an ANSI standard language designed to operate and manage databases. Using SQL you can:

  • Execute queries against and retrieve data from a database.
  • Insert, update and delete records in a database.
  • Create new databases, tables, procedures and views.
  • Set user permissions on tables, procedures and views.

SQL Order of Operations

SQL has a list of commands/clauses which need to be written in a particular order. Here is the basics to getting this order right:

  1. SELECT (selects data from a database).
  2. FROM (specifies the table you're pulling data from).
  3. WHERE (acts as a filter to match a specified condition).
  4. GROUP BY (groups data into logical sets).
  5. HAVING (acts like the WHERE clauses specifically for groups).
  6. ORDER BY (sets the order of results, followed by DESC for descending order or ASC for ascending order).

SQL Query Example

Below is an example of a query written using all the commands specified in the order of operations to give you an idea of how this is done in practice:

This query does contain a few other clauses and expressions that have not been covered in this blog which I plan on writing about in the future, but I hope this example demonstrates how SQL queries are written.

Author:
Edward Gay
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