PostgreSQL#

PostgreSQL is a powerful, open source object-relational database system that uses and extends the SQL language combined with many features that safely store and scale the most complicated data workloads.


Download PostgreSQL#

Mac#

  • Download the latest version of postgresapp

  • Download pgAdmin, an open source administration and development platform for PostgreSQL.

Windows#

  • Download the latest version of PostgreSQL and install PostgreSQL server and pgAdmin (a graphical tool for managing and developing your databases). You don’t need to install StackBuilder.


PostgreSQL in VS Code#

SQL example:

-- create table
CREATE TABLE teachers (
    id serial,
    first_name varchar(25),
    last_name varchar(50),
    school varchar(50),
    hire_date date,
    salary numeric
);

-- insert values 
INSERT INTO teachers (first_name, last_name, school, hire_date, salary)
VALUES ('Janet', 'Smith', 'F.D. Roosevelt HS', '2011-10-30', 36200), 
       ('Lee', 'Reynolds', 'F.D. Roosevelt HS', '1993-05-22', 65000),
       ('Samuel', 'Cole', 'Myers Middle School', '2005-08-01', 43500),
       ('Samantha', 'Bush', 'Myers Middle School', '2011-10-30', 36200),
       ('Betty', 'Diaz', 'Myers Middle School', '2005-08-30', 43500),
       ('Kathleen', 'Roush', 'F.D. Roosevelt HS', '2010-10-22',38500 ); 

PostgreSQL & Python#