سرچ كنيد relational algebra divide in sql
يه نمونه :
Division:
Find items in one set that are related to all of the items in another set. In a many-to-many relationship there are three tables, A, B, C with C as the table representing the many-to-many key pairs of A and B.
For simple division: What are the 'A_KEY's to which all 'B_KEY's belong?
select distinct A_KEY
from TABLE_C C
where not exists (
select B_KEY
from TABLE_B B
where not exists (
select *
from TABLE_C CC
where A.A_KEY = CC.A_KEY
and B.B_KEY = CC.B_KEY ))