Queries lesson 7 'between"


when i use SELECT * FROM movies
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%'


Read this for some inspiration


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


just type

SELECT * FROM movies
WHERE year BETWEEN 1990 AND 2000
AND genre = 'comedy';