What I am trying to do is add a section the website that automatically assigns a department to a product when an administrator creates a product. For example, if I create a "t-shirt" product then it gets assigned the the "shirts" department. I need to get the tables connected in the db so that when a department is loaded, all the associated products show up. When I run a join between the two tables this is what I am running:
select d.Name, p.Name
from products p
inner join departments d on p.Id = d.Id
And I'm getting my only two products which I've manually assigned a department.
Can I get some help with what I need to do next to get every product automatically associated with a department?