topics table
The topics table in the Reddit Clone Database Schema schema has 5 columns, keyed by id, with 1 foreign key to topics. 1 column in subreddit_topics references it.
The site-wide interest taxonomy behind discovery and ad targeting. Self-referencing so Gaming can hold Strategy Games without a second table.
Columns (5)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| parent_id | uuid | references topics.id | |
| slug | varchar(80) | unique, not null | |
| name | varchar(80) | not null | |
| position | smallint | not null |
Indexes (1)
(parent_id, position)
Relationships
topics.parent_idreferencestopics.idsubreddit_topics.topic_idreferencestopics