Skip to content
HN On Hacker News ↗

GitHub - boringcollege/postgres-by-example: Yet another postgresql book!

▲ 50 points 7 comments by thenewedrock 2w ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully human-written

22 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 1 of 1
SEGMENTS · AI 0 of 1
WORD COUNT 232
PEAK AI % 22% · §1
Analyzed
Jun 10
backend: pangram/v3.3
Segments scanned
1 windows
avg 232 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 232 words · 1 segments analyzed

Human AI-generated
§1 Human · 22%

Postgres by Example PostgreSQL is a powerful, open-source relational database. Please read the official documentation to learn more. Postgres by Example is a hands-on introduction to PostgreSQL using annotated SQL examples. Check out the first example or browse the full list below. Prerequisites: PostgreSQL installed and the server running. Examples assume you can connect with psql; the default database is postgres unless noted. Start the server with your system's service manager or pg_ctl start as needed. Unless stated otherwise, examples target current stable PostgreSQL. Use the latest version you can if something isn't working. Table of Contents Getting Started

First Query psql Basics

Querying

SELECT Basics WHERE ORDER BY SELECT from a Table LIMIT and OFFSET DISTINCT NULLs Expressions

Data Types

Numeric Types Text Types Boolean and Dates UUID and JSONB

DDL

CREATE TABLE Column Types and Constraints ALTER TABLE and DROP Primary Keys and Unique NOT NULL and DEFAULT

DML

INSERT UPDATE DELETE RETURNING

Joins and Sets

INNER and LEFT JOIN RIGHT and FULL JOIN Self-Join UNION, INTERSECT, EXCEPT

Aggregation and Grouping

COUNT, SUM, AVG GROUP BY HAVING

Subqueries

Scalar and IN Subqueries EXISTS and Derived Tables

Functions and Operators

String and Numeric Functions Date Functions and COALESCE CASE

Indexes

CREATE INDEX When to Index

Transactions

BEGIN, COMMIT, ROLLBACK Savepoints

Views

CREATE VIEW

Security

Roles and GRANT

Extras

psql Meta-commands COPY

Licensed under CC BY 4.0. by Dariush Abbasi | source