I have the following three tables:
- Product
- Purchase (contains ProductID as foreign key)
- Sale (contain ProductID as foreign key as well)
I want to form query joining these 3 tables where my result is the product name, purchased, and sold.
Product Name
- (from Products table)
Purchased
- (Number of occurences in Purchase table according to ProductID)
Sold
- (Number of occurences in Sale Table according to ProductID)
Can you please set me on the right track by giving me hints and I'll complete by myself?