CodingNic

SQL Basics

Module Overview

SQL Basics 5 min read

Module Overview

What You’ll Learn

  • Understand SQL syntax
  • Write basic SQL queries
  • Retrieve data from tables
  • Use aliases and comments

💡 Why this module matters: Module 1 got PostgreSQL running, this module is where you actually start talking to it. SELECT is the query you’ll write more than every other kind of SQL statement combined, and everything else in this course builds on reading it correctly.

What’s Covered

  • SQL syntax and SQL statements, the general shape every query in this course shares.
  • Keywords and identifiers, telling SQL’s own vocabulary apart from the names you choose.
  • SQL comments, -- and /* ... */, for explaining a query to the next person reading it.
  • Literals and expressions, the values you write directly into a query, and the calculations SQL can do with them.
  • SELECT, reading rows and columns back from a real table.
  • DISTINCT, removing duplicate values from a result.
  • Column aliases (AS), renaming a column in a result set without touching the underlying table.

Hands-On

By the end of this module, you’ll be comfortable writing a SELECT query against a real table: retrieving specific columns, removing duplicates with DISTINCT, and using aliases, all practiced against a sample products table set up early in the module.

Table creation, so you can build a table like this one yourself, starts next module.