I am making a DB for storing reports that have following fields:
Ad_system,
Ad_Campaing,
Ad_Group,
Keyword,
Date,
Impressions,
Clicks,
Conversions
Logic is that, Ad_system
can have multiple Ad_Campaings
, Ad_Campaing
can have multiple Ad_Groups
and Ad_Groups
can have multiple Keywords
, and for every Keyword
there is a report
. Should It be like this? Because it kind of makes sense to me, but it doesn't look correct. Primary key can also be:
ad.system.name
for first table
ad.system.name ad.campaing.name
for second table
ad.system.name ad.campaing.name ad.group.name
for third table
ad.system.name ad.campaing.name ad.group.name keyword
for fourth table
They will always be unique, but then Report
will always have all DB columns in it, so it's kind of redundant. Is the approach that I have in the diagram below correct? Or is a better one what I just described? If I am not mistaken both should satisfy 3rd NF.
report
when there apparently has to be a report for every keyword.