0
0
PostgreSQLquery~5 mins

Standard comparison operators in PostgreSQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the = operator do in SQL?
The = operator checks if two values are equal. It returns true if they are the same, otherwise false.
Click to reveal answer
beginner
What is the difference between <> and != in PostgreSQL?
Both <> and != mean "not equal to" in PostgreSQL. They work the same way and return true if values are different.
Click to reveal answer
beginner
How does the < operator work in SQL?
The < operator checks if the value on the left is less than the value on the right. It returns true if yes, otherwise false.
Click to reveal answer
beginner
What does the >= operator check?
The >= operator checks if the left value is greater than or equal to the right value. It returns true if either condition is met.
Click to reveal answer
intermediate
Can you use comparison operators with text values in PostgreSQL?
Yes, you can use comparison operators like =, <, > with text. They compare strings based on alphabetical order.
Click to reveal answer
Which operator checks if two values are NOT equal in PostgreSQL?
A<>
B=
C<=
D>=
What does the <= operator mean?
ALess than or equal to
BGreater than
CLess than
DEqual to
If you want to check if a value is greater than another, which operator do you use?
A<
B>
C=
D<>
Which operator would return true if two values are exactly the same?
A!=
B<>
C=
D>=
Can you use < to compare text values in PostgreSQL?
AOnly boolean values
BNo, only numbers
COnly dates
DYes, it compares alphabetically
Explain how the standard comparison operators work in PostgreSQL and give examples.
Think about how you compare numbers or words in real life.
You got /3 concepts.
    Describe the difference between equality and inequality operators in SQL.
    Equality means same, inequality means different.
    You got /3 concepts.