0

So I have two tables called Product and Product_Review where Product_Review holds reviews for products that are already defined in the Product table with their attribute C_CODE. We were given an assignment to join these two tables by their Product ID so naturally I went with:

SELECT * 
FROM PRODUCT INNER JOIN 
     PRODUCT_REVIEW 
     ON PRODUCT.C_CODE=PRODUCT_REVIEW.C_PRODUCT_ID

However we were given the answer afterwards with a different method without any joins being performed:

SELECT * 
FROM PRODUCT, PRODUCT_REVIEW 
WHERE PRODUCT.C_CODE=PRODUCT_REVIEW.C_PRODUCT_ID

My question is what is the difference between these two commands and if there isn't any difference then why do we need the join command when we can just perform a basic select?

Yogesh Sharma
  • 49,870
  • 5
  • 26
  • 52
David Mason
  • 121
  • 1
  • 7
  • 3
    There is no difference. The second one is extremely outdated syntax though –  Jan 07 '20 at 18:06
  • See https://stackoverflow.com/questions/20467662/the-difference-between-comma-and-join-in-sql –  Jan 07 '20 at 18:07

0 Answers0