Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMehiret Abdissa
415 PointsCreate a list of all fruits and vegetables starting with the letters A through K
https://teamtreehouse.com/library/querying-relational-databases/set-operations/set-operations
I wrote the query as follows :
Select DISTINCT *from fruit union select DISTINCT *from vegetable where Name Like '%A_k%'
5 Answers
Agnes Demes
6,613 PointsSELECT Name FROM Fruit WHERE Name <"L" UNION SELECT Name FROM Vegetable WHERE Name <"L";
Mehiret Abdissa
415 PointsDid you got the answer is right?
Mine is still there is error.> select Name from Fruit where Name Like '%A_k%' Union select Name from Vegetable where Name Like '%A_k%'
Blackberry Blackcurrant Daikon Radish Jackfruit
Agnes Demes
6,613 PointsHi Mehiret, in your example the Like keyword is specifying values %A starting with A and having the letter K in them..may be this would return ArtichoKe.. you could use a solution WHERE Name < "L" meaning where the name starts with A - K as these letters are all smaller then L. hope this helps
Mehiret Abdissa
415 PointsHi Agnes,
i am still getting the error : Your UNION queries didn't bring back a union of fruits and veggies!
Please Help Me!!
Mehiret Abdissa
415 PointsThank you So much !! I did It!!
Agnes Demes
6,613 PointsThese quizes are asking for very specific results, you could add an extra column and get an error. bring back the Name columns only in both tables.
Agnes Demes
6,613 Pointsoh good, happy coding :)