What Is PostgreSQL

Not started · 0% · difficulty 1/5

✎ Edit knowledge

Relational model, tables, rows, and where Postgres fits.

Topics

1. Practice

practice · 7 tasks

Practice

Practice · 1 / 7

In the relational model, what is a single entry in a table called?

Knowledge

PostgreSQL, a relational database

PostgreSQL (often called "Postgres") is a free, open-source relational database management system (RDBMS). It stores data in tables and lets you query and change that data using SQL. It is known for strict standards compliance, reliability, and rich features such as transactions, JSON support, and extensibility.

In the relational model, data lives in tables (also called relations). A table has named columns, each with a data type, and holds zero or more rows (also called records or tuples). Every value in a given column shares that column's type.

A concrete table

CREATE TABLE employee (
    id         integer PRIMARY KEY,
    name       text NOT NULL,
    department text,
    salary     numeric
);

INSERT INTO employee (id, name, department, salary)
VALUES (1, 'Amina', 'Engineering', 90000),
       (2, 'Bruno', 'Sales',        65000),
       (3, 'Chen',  'Engineering', 88000);

Here the columns are id, name, department, and salary. Each INSERT adds one row. The PRIMARY KEY on id means every row must have a unique, non-NULL id that identifies it.

Key vocabulary

  • Table (relation): a named collection of rows with a fixed set of typed columns.

  • Row (record, tuple): one entry in a table.

  • Column (attribute, field): a named, typed slot present in every row.

  • Primary key: a column (or set of columns) whose value uniquely identifies each row.

  • Schema: a namespace that groups tables; the default schema is public.

Where Postgres fits

Postgres is a good default for applications that need durable, consistent storage with relationships between entities: users, orders, products, and so on. Because it is ACID-compliant, a committed transaction survives crashes and concurrent clients see a consistent view of the data. You interact with it by sending SQL statements, typically via the psql command-line client or a driver in your programming language.

SQL statements fall into broad families: DDL (Data Definition Language) like CREATE TABLE defines structure; DML (Data Manipulation Language) like INSERT, UPDATE, DELETE changes data; and queries with SELECT read data back out.