Questions tagged [relational-division]

Operation in relational algebra or in an RDBMS (mostly SQL) to partition relations. The inverse of a Cartesian product (CROSS JOIN in SQL).

E.F. Codd identified eight relational algebra operators in his defining paper "A Relational Model of Data for Large Shared Data Banks". Division is the least known and probably most complex of them. It is the inverse operation of a Cartesian product (CROSS JOIN in SQL).

It means partitioning a (bigger) table with rows from another (smaller) table. For requirements like:
"Find tuples that combine a particular value in one attribute with several values in another attribute."

A practical example for a setup with a many-to-many relationship between clubs and people:
"Find all clubs where Sue and John and James are members."

More information

467 questions
-4
votes
1 answer

SQL query to find those customer who have buy all three items ('ring','diamond','brooch')

id item_name cust_id 1 Rolex 5 2 Diamond 33 3 Hublop 1 4 Ring 9 5 Ruby 13 6 Rolex 33 7 Hublop 29 8 Ring 17 9 Belt 21 10 Diamond …
-4
votes
3 answers

An SQL query to get the exact matching results

In my MySQL database, I have three tables students, classes, courses. One class has many students. One class has many courses. The courses table has one boolean field active, and a string field name. So overall relationship is (sorry I am not sure…
Leem
  • 17,220
  • 36
  • 109
  • 159
1 2 3
31
32