Problem with task 2 of 6
I don't know what's the problem with my query:
SELECT Name FROM Fruit WHERE Name BETWEEN "A" AND "K" UNION SELECT Name FROM Vegetable WHERE Name BETWEEN "A" AND "K" ORDER BY Name;
Could you help me? Thanks
Robert Stefanic35,143 Points
There's a small syntax problem here, but you're on the right track.
You want to select Fruits and Vegetables where the Name is >= a letter and less than or equal to another letter; however, when I tried doing
"Name <= 'K', it gave me an error. If I did
name < 'L', then everything worked just fine. Even though the former should work, it didn't (for me at least). So the part that checks your input must be very specific.
SELECT Name FROM Fruit WHERE Name >= 'A' AND Name < 'L' UNION SELECT Name FROM Vegetable WHERE Name >= 'A' AND Name < 'L' ORDER BY Name