SQL Queries Exercise #4 "Where"


#1

https://www.codecademy.com/courses/learn-sql-queries/lessons/queries/exercises/where?action=lesson_resume&course_redirect=learn-sql

Hey guys,

In the link provided above is a exercise where the code says:
SELECT * FROM movies
WHERE name LIKE ‘Se_en’;

Which gave me 2 query result:

id name genre year imdb_rating
219 Se7en drama 1995 8.6
220 Seven drama 1979 6.1


So i was wondering what would happened if i re-write the code to
SELECT * FROM movies
WHERE name LIKE ‘Se7en’;

And it came out with only 1 query result:

id name genre year imdb_rating
219 Se7en drama 1995 8.6


How does this work?

My guess is that the “_” would replace any letter that is between “Se(Any letter)en” and show as a query result.
E.g:: Se§en,Se(t)en,Se®en would show as a query result if it were to exist in the movie database
Am i close?

Thanks.


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.