ad_targeting_rules table

The ad_targeting_rules table in the Reddit Clone Database Schema schema has 5 columns, keyed by id, with 1 foreign key to ad_campaigns.

Include and exclude rules in one table with an operator, because targeting is always a set expression and splitting it into two tables makes evaluation order ambiguous.

Columns (5)

Columns of the ad_targeting_rules table
ColumnTypeConstraintsDescription
iduuidprimary key
campaign_iduuidnot null, references ad_campaigns.id
dimensiontargeting_dimensionnot null
operatortargeting_operatornot null
valuevarchar(200)not null

Indexes (1)

  • (campaign_id, dimension)

Relationships