And to find the lowest commission that any of the sales staff is earning, use this: : MIN « Aggregate Functions « SQL / MySQL






And to find the lowest commission that any of the sales staff is earning, use this:

      
mysql>
mysql>
mysql> CREATE TABLE sales_rep(
    ->   employee_number INT,
    ->   surname VARCHAR(40),
    ->   first_name VARCHAR(30),
    ->   commission TINYINT
    -> );
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>
mysql> INSERT INTO sales_rep values(4,'Rive','Mongane',10);
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO sales_rep values(5,'Smith','Mike',12);
Query OK, 1 row affected (0.00 sec)

mysql>
mysql>
mysql> SELECT MIN(commission) FROM sales_rep;
+-----------------+
| MIN(commission) |
+-----------------+
|              10 |
+-----------------+
1 row in set (0.00 sec)

mysql>
mysql> drop table sales_rep;
Query OK, 0 rows affected (0.00 sec)

   
    
    
    
    
    
  








Related examples in the same category

1.Returns the minimum value from a group of values: MIN()
2.Use MIN( ) or MAX( ) With a GROUP BY clause
3.MIN( ) and MAX( ) also work with expressions or values that are derived from column values.
4.Do calculation with aggregate function
5.Controlling String Case Sensitivity for MIN( ) and MAX( )
6.What are the lowest and highest U.S. state populations?
7.To make bstr not case sensitive, you can convert the values to a given lettercase:
8.What are the shortest and longest trips in the mytable table?