• Posts
  • Spatial Lab
  • Modern GIS Accelerator
  • The Spatial SQL Book

Get the newsletter

Join 71,000+ geospatial experts growing their skills and careers. Get updates on the most cutting edge updates in modern GIS and geospatial every week.

Edit Content
  • LinkedIn
  • YouTube
Uncategorized

Spatial SQL for GIS and Geospatial: Basic SQL

November 11, 2022 Matt Forrest Comments Off on Spatial SQL for GIS and Geospatial: Basic SQL
Learn Spatial SQL

Welcome to the first in a series of videos and posts on learning spatial SQL. This will focus on learning the core elements of SQL, and in the name of not reinventing the wheel, there are already such great resources to learn SQL.

The Spatial SQL Book – Available now!

Check out my new book on Spatial SQL with 500+ pages to help you go from SQL novice to spatial SQL pro.

Buy now!

What you need to know

Here are some of the top things you should focus on when learning SQL. Of course, there are more but this is a good base list to choose from.

  • SELECT
  • WHERE, AND/OR, (NOT) IN, BETWEEN
  • LIMIT
  • Handing NULL data
  • Using SQL functions
  • Aggregations – MIN/MAX/AVG/SUM/COUNT and GROUP BY
  • CASE WHEN
  • Joins
  • CTEs or Common Table Expressions
  • Subqueries

I also like these posts from Nick Singh and Eric Weber and the comments that have other items as well.

Courses for SQL

Mode SQL Course

The Mode SQL course is a great tool that breaks down every aspect of SQL from end to end for a beginner with absolutely no experience up to those looking for more advanced tutorials. It also allows you to practice with sample data in their platform and has some programming challenges at the end.

Mode SQL Tutorial
Mode SQL Course
Mode SQL Course

Learn SQL

I really like Learn SQL which has a few different options. You can select a course on a very specific topic like window functions or joins, run through monthly practice sessions, or complete courses. You don’t need to set anything up and you can run all your queries and sessions right from your browser.

Go to Learn SQL
LearnSQL.com
LearnSQL.com

Practice SQL Online

Here are some of the best resources to practice your SQL skills online.

Stratascratch

Practice real SQL use cases and questions from interview questions from a variety of companies all from your browser. Stratascratch is just like Leetcode, but built for and by data scientists and analysts. You can also practice Python and other languages too.

Sign up for Stratascratch
Practice SQL with Stratascratch
Practice SQL with Stratascratch

SQL Bolt

This is a practical and contained SQL tutorial that allows you to practice a range of basic concepts all in your browser. Simple and easy to get started.

SQL Bolt
Learn Spatial SQL
Learn Spatial SQL

Reference guides for SQL

You always need to look things up, and outside of the code docs (which I definitely recommend becoming familiar with), these are great tools for great quick look-ups as you are working with SQL.

PostgreSQL Tutorial

This is a very comprehensive toolkit for referencing SQL functions and checking and referencing quick guides and proper usage.

PostgreSQL Tutorial
PostgreSQL Tutorial
PostgreSQL Tutorial

W3 Schools

W3 Schools has so many resources for a lot of languages, and SQL is no different. You can quickly find any reference on the site and then see the structure, usage, and actually run the code in the browser too.

W3 Schools for SQL
W3 Schools for SQL

Other Resources

Advanced SQL from Taylor Brownlow

This series of 5 posts is one of the best set of really comprehensive posts on advanced SQL topics such as common table expressions, dates, joins, window functions, and user-defined functions. These are incredibly well written so I recommend them for beginners and as refreshers for advanced users.

Find all posts here
Advanced SQL Tutorials
Advanced SQL Tutorials

Spatial SQL Cookbook

This is a quick reference guide I put together for some spatial SQL code snippets.

Spatial SQL Cookbook

Learn SQL Cheatsheets

Everyone loves a cheat sheet! These are an amazing visual reference for more simple and advanced topics.

SQL Basics Cheat Sheet
SQL Joins Cheat Sheet
SQL Windows Cheat Sheet
SQL Cheat Sheet
SQL Cheat Sheet

Data by Danny SQL Challenge

Data by Danny is one of the best resources for SQL online! Follow him on LinkedIn and make sure to check out his resources page. There are free resources, code challenges, and a link to his super comprehensive course called the 8 Week SQL Challenge.

Data by Danny SQL Resources
  • Spatial SQL
Matt Forrest

Post navigation

Previous
Next

Search

Categories

  • Article (25)
  • Essay (1)
  • Podcast (3)
  • Tutorial (5)

Recent posts

  • How Cloud Storage Powers Cloud-Native Geospatial, AI, and Analytics
  • Get Featured in the 2025 Geospatial Landscape Report (Submit Your Company Today)
  • Apache Sedona Tutorial: Scalable Spatial Joins and Geospatial Processing with Spark

Tags

aggregations Apache Airflow Apache Iceberg Apache Sedona bigquery Cloud GIS Cloud Optimized GeoTIFF duckdb geoparquet geospatial gis Modern GIS postgis Python snowflake Spatial SQL sql zip codes

Related posts

Article

Scaling GIS Workflows with COGs, Airflow, and Apache Iceberg

April 25, 2025 Matt Forrest Comments Off on Scaling GIS Workflows with COGs, Airflow, and Apache Iceberg

TOP OF THE STACK What we need to do with COGs COGs (Cloud-Optimized GeoTIFFs) are one of the most promising tools we have for making raster data truly cloud-native. They let you stream just the pieces you need, work remotely, and plug into modern geospatial systems without downloading giant files. But after working closely with […]

Article

From Desktop GIS to Cloud: A Beginner’s Roadmap to Modern GIS Tool

March 7, 2025 Matt Forrest Comments Off on From Desktop GIS to Cloud: A Beginner’s Roadmap to Modern GIS Tool

Modern GIS is changing fast. If you’ve been working with QGIS, ArcGIS, or any other desktop GIS tool, you’ve probably hit some limitations—datasets getting too big, processing times slowing down, and collaboration becoming a challenge. The good news? The cloud offers a way forward. But how do you make that transition? How do you go […]

Article

The Top 11 Open GeoParquet Datasets: Making big geospatial data easy

January 18, 2024 Matt Forrest Comments Off on The Top 11 Open GeoParquet Datasets: Making big geospatial data easy

In the dynamic field of geospatial technology, the evolution of data formats plays a pivotal role in shaping how we interact with and interpret spatial information. The advent of GeoParquet has marked a significant milestone, offering a more efficient and accessible way to handle large spatial datasets. This blog post delves into a comprehensive exploration […]

Spatial Lab
  • Join the Spatial Lab community
Policies
  • Privacy Policy
  • Terms & Conditions
Spatial SQL
  • Get the Spatial SQL book today
Join Us

© Matt Forrest 2024. All Rights Reserved.