We have been learning SQL Server programming in Database Systems class. The professor goes exceptionally fast and is not very open to asking questions. I did ask him this, but he just advised me to review the code he'd given (which doesn't actually answer the question).
When making a query, what is the difference between using the term JOIN and using the "=" operator? For example, I have the following query:
SELECT VENDOR_NAME, ITEM_NAME, QTY
FROM VENDOR, VENDOR_ORDER, INVENTORY
WHERE VENDOR.VENDOR_ID = VENDOR_ORDER.VENDOR_ID
AND VENDOR_ORDER.INV_ID = INVENTORY.INV_ID
ORDER BY VENDOR_NAME
In class the professor has used the following code:
SELECT DISTINCT CUS_CODE, CUS_LNAME, CUS_FNAME
FROM CUSTOMER JOIN INVOICE USING (CUS_CODE)
JOIN LINE USING (INV_NUMBER)
JOIN PRODUCT USING (P_CODE)
WHERE P_DESCRIPT = 'Claw hammer';
It seems to me that using a join is performing the same function as the "=" is in mine? Am I correct or is there a difference that I am unaware of?
Edit: Trying to use Inner Join based on things I've found on Google. I ended up with the following.
SELECT VENDOR_NAME, ITEM_NAME, QTY
FROM VENDOR, VENDOR_ORDER, INVENTORY
INNER JOIN VENDOR_ORDER USING (VENDOR_ID)
INNER JOIN INVENTORY USING (INV_ID)
ORDER BY VENDOR_NAME
Now I get the error message ""VENDOR_ID" is not a recognized table hints option. If it is intended as a parameter to a table-valued function or to the CHANGETABLE function, ensure that your database compatibility mode is set to 90. " I'm using 2014, so my compatibility level is 120.