Can I not add multiple conditions to a single WHERE statement?

Hello!

I’m learning the Where function as part of SQL queries. https://www.codecademy.com/courses/learn-sql/lessons/queries/exercises/where

Why am I not able to run two simultaneous conditions using a single WHERE?

SELECT *
FROM movies
WHERE imdb_rating < 5, year > 2014;

I typed the above in the code editor, but the results did not turn out as expected.

Can someone please tell me where I’m going wrong? Thanks in advance!

Yep, you can add multiple conditions to a WHERE clause.
BUT,
You have to use AND with your WHERE clause.
Ex:


SELECT *
FROM movies
WHERE imdb_rating < 5
AND year > 2014;

Your results would be rows where both conditions are True.

2 Likes