Excellent! As you can see, the database sorted the results in the order we asked for. Convenient, isn't it?
We can also compare text information using the logical operators (<
, >
, <=
, >=
, =
, !=
) that you learned in the SQL Basics course.
It's quite easy to use =
(equals) and !=
(not equals), and the result is pretty much predictable. The following statement ...
SELECT
*
FROM user_account
WHERE first_name = 'Mark';
... will select all the Marks in the database. But how about the following statement?
SELECT
*
FROM user_account
WHERE nickname >= 'D';
The above query will select all users whose nickname starts with D, E, F, etc. Since A, B, and C come earlier in the alphabet (they are "lower", so to speak), nicknames starting with those letters will be skipped.