SQL and databases

Stage 1 · Lesson 3 of 8

The families of SQL statements

Relational thinking and your setup

SQL statements come in a few families, grouped by what they touch. (CREATE, ALTER, DROP) builds and changes tables. Data manipulation language (SELECT, , UPDATE, DELETE) reads and changes the rows inside them.

Data control language (GRANT, REVOKE) decides who may do what. control (BEGIN, COMMIT, ROLLBACK) groups changes so they all succeed or all fail together. Knowing the family tells you the risk.

A wrong SELECT only shows you the wrong rows. A wrong DROP, or an UPDATE without a WHERE condition, can destroy data. Your first weeks will be mostly SELECT, and later stages cover the others in turn.

Common trapassuming every change can be undone: MySQL commits most DDL (changes to tables) immediately, while and can roll DDL back inside a transaction.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • CourseFree
    CS50's Introduction to Databases with SQL

    Harvard University · Beginner

    Watch Lecture 0 (Querying) for the relational model; it uses SQLite, and the ideas carry straight across

  • GuideFree
    PostgreSQL Tutorial

    PostgreSQL Global Development Group · Beginner

    The short official tutorial: Chapters 1 and 2 cover creating a database and your first tables

Keep handy

  • Read the installation and psql pages for your platform, and bookmark the SQL commands reference

  • A one-page map of SQL topics: use it to see where each stage of this roadmap fits

Mark this stage as not done?