0

If I had these tables

+--------+-----+ 
|   ID   | oid | 
+--------+-----+ 
| 0      |  1  | 
| 2      |  1  | 
| 0      |  2  | 
+--------+-----+ 
+--------+ 
|   num  |
+--------+ 
| 1      | 
| 2      | 
+--------+

I would get ID 0 back because it has both num 1 and 2.

How would I go about getting that?

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
delishas
  • 17
  • 1
  • 3
  • 1
    I voted to close this as a duplicate of another question. The other question was asked about Microsoft SQL Server, but this problem — relational division — and its solution is independent of the brand of SQL. – Bill Karwin Jan 09 '20 at 05:09
  • @BillKarwin I don't think any of the answers will solve delishas's problem, I will vote to reopen – Ali Faris Jan 09 '20 at 05:54
  • Re the BCNF question you just deleted: Presuming that your FD set is a cover, none of the FDs determine B or D so those must be in any CK. BDA & BDE are CKs but so is BDC & there are no more. Even if we ignored whether your CK set & decomposition are correct & just considered the 1st question sentence "Is R2 in BCNF?", if you don't know how to answer that then you need to try to answer it & ask a question about following & being stuck or finished in applying quoted/referenced (authoritative) definition(s) and/or algorithm(s). – philipxy Feb 07 '20 at 05:34

0 Answers0