Blog

authors, posts, comments and tags. 5 tables, 17 columns, no data.

The map

Map of the 5 tables and their linksN1N1N1N1N1authorsPKidbigintnamevarcharbiotexttagsPKidbigintlabelvarcharpostsPKidbigintFKauthor_idbiginttitlevarcharbodytextpublished_attimestamptzcommentsPKidbigintFKpost_idbigintFKauthor_idbigintbodytextcreated_attimestamptzpost_tagsFKpost_idbigintFKtag_idbigint

Each line runs from a linking column (N) to the key it points at (1). The same tables are listed below as text.

The tables

authors

  • id bigintPK
  • name varchar(200) required
  • bio text

posts

  • id bigintPK
  • author_id bigint→ authors required
  • title varchar(300) required
  • body text
  • published_at timestamptz

comments

  • id bigintPK
  • post_id bigint→ posts required
  • author_id bigint→ authors
  • body text required
  • created_at timestamptz required

tags

  • id bigintPK
  • label varchar(60) required

post_tags

  • post_id bigint→ posts required
  • tag_id bigint→ tags required

What you could look at in SSDO

Create a free workspace and open this sample   All samples

PK is a primary key. “→ table” is a link (a foreign key) to that table. This page is a description of a structure we wrote; it holds no rows.