Welcome to PostgreSQL. The following few chapters are intended to give a simple introduction to PostgreSQL, relational database concepts, and the SQL language to those who are new to any one of these aspects.
Before you can use PostgreSQL you need to install it. It is possible that PostgreSQL is already installed at your site, either because it was included in your operating system distribution or because the system administrator already installed it.
SQL is the standard language for interacting with relational databases.
This chapter provides an overview of how to use SQL to perform simple operations.
CREATE TABLE weather (
city varchar(80),
temp_lo int, -- low temperature
temp_hi int, -- high temperature
prcp real, -- precipitation
date date
);
INSERT INTO weather VALUES ('San Francisco', 46, 50, 0.25, '1994-11-27');
INSERT INTO weather (city, temp_lo, temp_hi, prcp, date)
VALUES ('San Francisco', 43, 57, 0.0, '1994-11-29');
SELECT * FROM weather;
SELECT city, temp_lo, temp_hi, prcp, date FROM weather;
Continue to Chapter 3. Advanced Features.