r/DatabaseHelp • u/Cloud_The_Stampede • Oct 02 '16
Help with SQL server 2014 Select clauses.
I have an assignment that has been driving me crazy, I have been researching online with helpful information but I believe is beyond my comprehension.
I have two tables one has information about items containing the price of the item, the second has information about the vendor with company name information.
The statement I am supposed to write is going to give me results with data that has greater than 1000$ in price and contain the name "new" in the vendor list.
So far I have:
select ItemID, ItemDescription, CompanyName
from ITEM, VENDOR
Where ItemPrice > 1000 Having like 'New';
I kept getting syntax errors and again have tried to research the problem with no luck please help!
View all comments
Show parent comment
3
u/Grundy9999 Oct 02 '16
So since this is a school assignment I will use the socratic method - would you expect your subquery statement to select the company named "SuperNew Inc."? Why or why not? Also, which is more efficient - using an implicit cross-join plus subquery, or specifying an explicit join and putting multiple conditions in the where clause?