⬅️ Execute program MySQL

WHERE

SELECT * FROM users WHERE name = 'Amir';
SELECT email FROM users WHERE name = 'Amir';
  • Note that the standard equality operator in SQL is =
  • Most SQL databases support not-equal comparisons with the familiar != operator. Sometimes you’ll also see the <> operator, as in a <> b, which means the same thing.
  • AND and OR
  • length
SELECT name FROM users WHERE length(name) > 4
  • Different database systems provide different functions. SQLite only provides a few functions, but PostgreSQL provides hundreds. We can also define our own functions, then use them in queries.