I have two tables,
diary with columns
id primary key
Narrative text
and
master with columns
id primary key
Diaryid int
EventDate date
Location int

I want to ensure that master(Diaryid) is always a valid diary(id)

Can I use foreign key to achieve this? Bearing in mind that one key is a primary key and the other int.

Any advice would be apprecaited.