when i use SELECT * FROM moviesWHERE name BETWEEN 'A' AND 'J';The statement filters the result set to only include movies with names that begin with letters "A" up to but not including "J".Why it is not including J whereas in query of year it is including 2000 year.
It would be the same as including up to 2000, you wouldn't get 2001 so including up to J means you won't get Ja.
It is including any title that is just J. You should test that by adding a movie that has a title like that.
Why it is not like this: BETWEEN 'A%' and 'J%'
@paralacksRead this for some inspiration http://stackoverflow.com/questions/9893329/sql-where-criteria-to-find-names-between-a-f http://stackoverflow.com/questions/5980783/sql-between-clause-with-strings-columns
Thanks @leonhard.wettengmx.n for the response. I have the question. The linked threads are a little complex for my understanding. Would you mind simply explaining why BETWEEN 'A%' and 'J%' wouldn't work?
I see " where name like 'A%' or name like 'J%' " referenced in another thread. Why do you have to use a LIKE statement with the wildcard?
Thanks for the help!
The answer from lesson 7 between are the letters "A" and "J" with the large size. If we put the letter with the small size as "a" and "j" will give error
SELECT * FROM moviesWHERE year BETWEEN 1990 AND 2000AND genre = 'comedy';