As noted in the SQL Gotchas section of Using the NOAO Data Lab, here are some good tutorials on SQL, and two links specific to PostgreSQL, the database technology used by the Data Lab:
Khan Academy Intro to SQL: Querying and managing data
Online SQL Tutorial; learn the mechanics interactively
Try some other online exercises geared to PostgreSQL
PostgreSQL SQL Language from the online manual
For specifics on the Astronomical Data Query Language (ADQL) used by the Data Lab TAP service, the IVOA maintains a reference manual.
416 questions
434 answers
440 comments
636 users