Let's assume I have the tables Job (JobPK INT etc.) and Employee (EmployeePK INT, Age INT etc.).
I want to create another table A, defined as:
CREATE TABLE A
(
JobFK INT,
EmployeeFK INT,
CONSTRAINT FOREIGN KEY (JobFK) REFERENCES Job(JobPK),
CONSTRAINT FOREIGN KEY (EmployeeFK) REFERENCES Employee(EmployeePK)
)
where I can add only those employees whose age is greater than 25, for example.
How can I do that?