SQL and databases

Stage 1 · Lesson 4 of 8

Installing PostgreSQL locally

Relational thinking and your setup

Install a current release on your own computer. On Windows, use the installer from postgresql.org, which can add pgAdmin (a graphical tool) too. On macOS, use or Homebrew.

On Linux, use your distribution's packages. Docker is a good alternative if you already use it. During setup, set a password for the postgres , the all-powerful admin account.

Note the port, which is 5432 by default, and check you can connect, for example with , the command-line client that comes with PostgreSQL. Then create your own database and a normal user for daily work, so you are not doing everything as the superuser.

A local server lets you break things, restore them and read , which a browser playground cannot.

Common trapinstalling several versions through different methods and then not knowing which server your client is talking to.

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?