Primary keys here would the equivalent of linked rows in anvil.
example:
teachers table has linked_student column
students table has linked_parent column
We want all the teachers who have a student who have a parent whose first name is bob
bob_parent = app_tables.parents.search(name='bob')
students = app_tables.students.search(linked_parent=q.any_of(*[[r] for r in bob_parent]))
teachers = app_tables.teachers.search(linked_student=q.any_of(*[[r] for r in student]))
When you do a linked row search with a query operator you need the arguments to be liveObjectArrays
(which I believe is just a table row inside a list)
some linked docs (none of which really satisfy the question but might support the underlying idea)