Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 26 Online
OpenStudy (anonymous):

What is the answer to this question please Modify the following query to return the results for Detroit Tigers players from every year EXCEPT 2012: SELECT playerID, yearID, teamID, AB, H, HR, BB, H/AB AS BA FROM Batting WHERE teamID='DET' Thank you

OpenStudy (anonymous):

Is there another table called that holds the years? If so, you will need to do an inner join between the years table and the batting table on yearID and reference the yeartable.Year in your Select Statement and filter would look like this WHERE Year <> '2012'

OpenStudy (anonymous):

Hi DMunson thank you for your help. I finally figure it out. I forgot to add AND playerID != 'cabremi01'. Once I did that it work. This is the right formula SELECT playerID, yearID, teamID, AB, H, HR, BB, H/AB AS BA FROM Batting WHERE teamID= 'DET' AND yearID >= 2000 AND playerID != 'cabremi01'

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!