Let's assume that we have one row in Company table with companyId 1. We can insert row in employee table that has companyId 1:
insert into Employee values (17, 'John', 1)
However, we cannot insert employee that has non-existing CompanyId:
insert into Employee values (17, 'John', 111111)
Msg ...