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 trialnaveen rajavasireddy
Courses Plus Student 1,783 PointsQuery works in SQL Playground but fails in quiz
2 tables fruit and vegetables. Create a list of all fruits and vegetables starting with letter A thru K
My solution: SELECT Name FROM Fruit WHERE Name >= 'A' AND Name <= 'K' UNION SELECT Name FROM Vegetable WHERE Name >= 'A' AND Name <= 'K';
2 Answers
KRIS NIKOLAISEN
54,972 PointsWould your query select:
Kale
Kiwifruit
Kohlrabi
Kohlrabi Greens
Kumquat
or just the letter K?
naveen rajavasireddy
Courses Plus Student 1,783 PointsOkay, Here is the answer: SELECT Name FROM Fruit WHERE Name > 'A%' AND Name < 'L%' UNION SELECT Name FROM Vegetable WHERE Name > 'A%' AND Name < 'L%'; The issue was with >= operator; = Doesn't work and hence the issue.
naveen rajavasireddy
Courses Plus Student 1,783 Pointsnaveen rajavasireddy
Courses Plus Student 1,783 PointsIt retrieves all names starting with A through K. So, yes, for K - it retrieves all of the above starting with letter K