w3resource

MySQL less than or equal operator

less than or equal operator

MySQL less than or equal operator checks whether an expression is either less than or equal to another expression.

Syntax:

<=

MySQL Version: 8.0

Example:

The following MySQL statement will fetch those publishers from the publisher table who have less than or equal to 6 branch offices.

Code:

SELECT pub_name,country,pub_city,no_of_branch
FROM publisher       
WHERE no_of_branch<=6;

Relational Algebra Expression:

Relational Algebra Expression: MySQL less than or equal operator.

Relational Algebra Tree:

Relational Algebra Tree: MySQL less than or equal operator.

Sample table: publisher


Output:

mysql> SELECT pub_name,country,pub_city,no_of_branch
    -> FROM publisher       
    -> WHERE no_of_branch<=6;
+------------------------------+-----------+-----------+--------------+
| pub_name                     | country   | pub_city  | no_of_branch |
+------------------------------+-----------+-----------+--------------+
| New Harrold Publication      | Australia | Adelaide  |            6 | 
| Pieterson Grp. of Publishers | UK        | Cambridge |            6 | 
+------------------------------+-----------+-----------+--------------+
2 rows in set (0.02 sec)

Slideshow of MySQL Comparison Function and Operators

Previous: LEAST()
Next: LESS THAN OPERATOR(<)



Follow us on Facebook and Twitter for latest update.