主外键不用纠结,你只要理解是这两个表关联的字段是哪些就行
关联的SQL:
select * from 表名A a,表名B b where a.字段1=b.字段1 and a.字段2=b.字段2--或者用inner join、left jion 、right join、full joinselect * from 表名A a join 表名B b on a.字段1=b.字段1 and a.字段2=b.字段2