A parent table:
int aTableId; (key)
String type;
String category;
B child table:
int bTableId; (key)
String title;
String type;
String category;
What I want to do is make the "combination" of type and category existing in table A as a foreign key to the combination of type and category in table B.
in a formula a.type == b.type && a.category == b.category must be satisfied to insert into table B.
Let me explain it again
A parent table
1. type : food, category : fruit
2. type: food, category: vegetables
3. type : person, category : head
If such a combination exists in A parent table,
food - fruit
food - vegetables
person - head
The above combination is It is possible to insert into table B, but
person - fruit
person - vegetables
food - head
This combination is not possible.
How can I achieve what I want?