Databases Querying Relational Databases Set Operations Set Operations

Can't get question 2 for set questions.

why does the below not work?

select name from fruit where name > "L" union select name from vegetable where name > "L";

Any tips?

2 Answers

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 51,733 Points

Having > "L" includes name from L to Z. You want < "L" for names A to K.

thanks for the help! It worked!

But I must admit I don't get why. Doesn;t it make sense that "name > "L" " represents letters greater than L? How does the logic work?

Sean M
MOD
Sean M
Treehouse Moderator 7,332 Points

I'd be more than happy to help. Are you able to link to the question?

Looks like Kris was able to help me resolve this. Thank you though!