# Thread: Not sure where to post this question

1. Registered User
Join Date
Nov 2011
Posts
8

## Not sure where to post this question

Hello all, thanks for taking the time to read my post. First off I'm learning about cartesian products and I can only ever find very basic examples such as:

A = {red, blue}
B = {shirt, hat}

A x B = {(red shirt), (red hat), (blue shirt), (blue hat)}

So the cartesian product written mathematically is:

A x B {(a, b): a ∈ A, b ∈ B} ?

But that's all I can find on examples really on youtube and stuff nothing really goes more indepth. Last years exam paper had this question and I'll probably get a similar question this year. Could anyone explain how I would go about answering it?

2. SQL Consultant
Join Date
Apr 2002
Location
Posts
20,002
belongs in Database Concepts & Design - dBforums

apply your AxB method and simply write out all combinations from those two tables

do you know what a natural join is?

3. Registered User
Join Date
Nov 2011
Posts
8
No not really. You say apply my A x B method to those tables but the tables have so much more data in them than the simple problem I answered. Can you demonstrate how you would begin to pair these up?

4. SQL Consultant
Join Date
Apr 2002
Location
Posts
20,002
let's say the tables are A (a1,a2) and B (b1,b2)

the cartesian product would be AxB = { (a1,a2,b1,b2): (a1,a2) ∈ A, (b1,b2) ∈ B }

simple, innit

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•