I have a pair of tables with parent-child relationship.
domain:
id int not null auto_increment primary_key
domain varchar(100) not null
domain_url:
id int not null auto_increment primary key
domain_id int not null
path varchar(512)
Here I want to keep path unique with in one domain. Across the domain path can be duplicating. What is the best constraint to apply on path.
Should I focus on composite key between domain_id and path. Is composite key a reliable solution?