Here is the simplified version of my problem. I have these tables:
Master table
id - name - surname - fathers name - mothers name
Names
id - name
Surnames
id - surname
I want to query master table but I want to get id's for name, father's name and mother's name from other tables. I want something like;
SELECT
'id from names table that matches record name'
, 'id from surnames table that matches record surname'
, 'id from names table that matches record fathers name'
, 'id from names table that matches record mothers name'
FROM master_table
My problem is that I don't know how to join same table multiple times.