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 trial

Databases

I tried LIKE '[a-k]%' I tried where Name >= 'A' and Name <= 'K' I give up

BS

3 Answers

Steven Parker
Steven Parker
231,128 Points

Since you didn't provide a link to the course page or reproduce the instructions I'm not sure what your intention is, but "<= 'K'" might not be what you want unless you want to include the letter "K" but nothing that begins with "K". If you want to include everything from A-K you would have better luck with "< 'L'" instead.

If that's not it, show your complete query and provide a link to the course page.

https://teamtreehouse.com/library/querying-relational-databases/set-operations/set-operations

second question where they ask list every fruit vegetable A-K

Steven Parker
Steven Parker
231,128 Points

I confirmed that my previous suggestion works in the challenge. Remember to apply the filter to both tables.

Here's the problem There are two tables Fruit and Vegetable table. The Fruit table has a FruitID and a Name column and the Vegetable table has a VegetableID and Name column. Create a list of all fruits and vegetables starting with the letters A through K . In other words all fruit and vegetables that don't start with the letter L to Z.

i tried this...

SELECT Name from fruit WHERE Name >= 'A' AND Name <= 'K'
UNION
SELECT name from vegetable WHERE Name >= 'A' AND Name <= 'K'

but got this

Bummer! Your UNION queries didn't bring back a union of fruits and veggies beginning with the letters A through K!

I'm giving up

Steven Parker
Steven Parker
231,128 Points

As I said already, my original suggestion ("Name < 'L'") works in the challenge.

Agree with Steven, confirmed this works correctly where adding the where clause in both statements.