Chuii

Dynamic Blinkie Text Generator at TextSpace.net

Kamis, 25 Maret 2010

Tugas MySQL BAB 4

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.67-community-nt MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select lcase('teknik informatika');

+-----------------------------+

| lcase('teknik informatika') |

+-----------------------------+

| teknik informatika |

+-----------------------------+

1 row in set (0.11 sec)

mysql> select lower('teknik informatika');

+-----------------------------+

| lower('teknik informatika') |

+-----------------------------+

| teknik informatika |

+-----------------------------+

1 row in set (0.02 sec)

mysql> select ucase('tehnik informatika');

+-----------------------------+

| ucase('tehnik informatika') |

+-----------------------------+

| TEHNIK INFORMATIKA |

+-----------------------------+

1 row in set (0.00 sec)

mysql> select upper('tehnik informatika');

+-----------------------------+

| upper('tehnik informatika') |

+-----------------------------+

| TEHNIK INFORMATIKA |

+-----------------------------+

1 row in set (0.00 sec)

mysql> select substring('tehnik infornatika',6);

+-----------------------------------+

| substring('tehnik infornatika',6) |

+-----------------------------------+

| k infornatika |

+-----------------------------------+

1 row in set (0.05 sec)

mysql> select substr('komputer',3);

+----------------------+

| substr('komputer',3) |

+----------------------+

| mputer |

+----------------------+

1 row in set (0.00 sec)

mysql> select substring('tehnik informatika',2,6);

+-------------------------------------+

| substring('tehnik informatika',2,6) |

+-------------------------------------+

| ehnik |

+-------------------------------------+

1 row in set (0.01 sec)

mysql> select substring('tehnik informatika',-11,5);

+---------------------------------------+

| substring('tehnik informatika',-11,5) |

+---------------------------------------+

| infor |

+---------------------------------------+

1 row in set (0.08 sec)

mysql> select left('tehnik informatika',6);

+------------------------------+

| left('tehnik informatika',6) |

+------------------------------+

| tehnik |

+------------------------------+

1 row in set (0.00 sec)

mysql> select right('tehnik informatika',11);

+--------------------------------+

| right('tehnik informatika',11) |

+--------------------------------+

| informatika |

+--------------------------------+

1 row in set (0.00 sec)

mysql> select ascii('5');

+------------+

| ascii('5') |

+------------+

| 53 |

+------------+

1 row in set (0.03 sec)

mysql> select ord('A') ord('a');

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near 'ord('

a')' at line 1

mysql> select hex(2250;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near '' at

line 1

mysql> select ord('A'),ord('a');

+----------+----------+

| ord('A') | ord('a') |

+----------+----------+

| 65 | 97 |

+----------+----------+

1 row in set (0.00 sec)

mysql> select hex(225);

+----------+

| hex(225) |

+----------+

| E1 |

+----------+

1 row in set (0.02 sec)

mysql> select char(66);

+----------+

| char(66) |

+----------+

| B |

+----------+

1 row in set (0.11 sec)

mysql> select char(66,85,78,65,70,73,84);

+----------------------------+

| char(66,85,78,65,70,73,84) |

+----------------------------+

| BUNAFIT |

+----------------------------+

1 row in set (0.03 sec)

mysql> select bin(8);

+--------+

| bin(8) |

+--------+

| 1000 |

+--------+

1 row in set (0.02 sec)

mysql> select insert('BunNugroho'3,1,'nafit');

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near '3,1,'

nafit')' at line 1

mysql> select insert('BunNugroho'3,1,'nafit');

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near '3,1,'

nafit')' at line 1

mysql> SELECT INSERT('BunNugroho'3,1,'nafit ');

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near '3,1,'

nafit ')' at line 1

mysql> select lenght('tehnik informatika');

ERROR 1305 (42000): FUNCTION lenght does not exist

mysql> select locate('format','tehnik informatika');

+---------------------------------------+

| locate('format','tehnik informatika') |

+---------------------------------------+

| 10 |

+---------------------------------------+

1 row in set (0.02 sec)

mysql> select ltrim(' tehnik informatika');

+--------------------------------+

| ltrim(' tehnik informatika') |

+--------------------------------+

| tehnik informatika |

+--------------------------------+

1 row in set (0.00 sec)

mysql> select trim(leading '+' from '++++MYSQL++++');

+----------------------------------------+

| trim(leading '+' from '++++MYSQL++++') |

+----------------------------------------+

| MYSQL++++ |

+----------------------------------------+

1 row in set (0.03 sec)

mysql> select space(15);

+-----------------+

| space(15) |

+-----------------+

| |

+-----------------+

1 row in set (0.00 sec)

mysql> select replace(www.lampung.go.id','.','dot');

'> '

-> ;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near '.id',

'.','dot');

'' at line 1

mysql> select replace(www.lampung.go.id','.', 'dot ');

'> '

-> ;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near '.id',

'.', 'dot ');

'' at line 1

mysql> select replace('www.lampung.go.id','.', 'dot ');

+--------------------------------------------+

| replace('www.lampung.go.id','.', 'dot ') |

+--------------------------------------------+

| wwwdot lampungdot godot id |

+--------------------------------------------+

1 row in set (0.03 sec)

mysql> select reverse(ABCDEFHTIJK');

'> '

-> ;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near '');

'' at line 1

mysql> select reverse('ABCDEFHTIJK');

+------------------------+

| reverse('ABCDEFHTIJK') |

+------------------------+

| KJITHFEDCBA |

+------------------------+

1 row in set (0.00 sec)

mysql> select quote("sekarang hari jum'at");

+-------------------------------+

| quote("sekarang hari jum'at") |

+-------------------------------+

| 'sekarang hari jum\'at' |

+-------------------------------+

1 row in set (0.08 sec)

mysql> select LPAD('TI',5,'++');

+-------------------+

| LPAD('TI',5,'++') |

+-------------------+

| +++TI |

+-------------------+

1 row in set (0.00 sec)

mysql> select RPAD('TI',8,'++');

+-------------------+

| RPAD('TI',8,'++') |

+-------------------+

| TI++++++ |

+-------------------+

1 row in set (0.02 sec)

mysql> select elt(1,'TI','TK','SI',MI','KA');

'> '

-> ;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near '','KA

');

'' at line 1

mysql> select elt(1,'TI','TK','SI','MI','KA');

+---------------------------------+

| elt(1,'TI','TK','SI','MI','KA') |

+---------------------------------+

| TI |

+---------------------------------+

1 row in set (0.03 sec)

mysql> select field('TI','TI','TK','SI','MI','KA');

+--------------------------------------+

| field('TI','TI','TK','SI','MI','KA') |

+--------------------------------------+

| 1 |

+--------------------------------------+

1 row in set (0.00 sec)

mysql> select find_in_set('TK','TI,TK,SI,MA,KA');

+------------------------------------+

| find_in_set('TK','TI,TK,SI,MA,KA') |

+------------------------------------+

| 2 |

+------------------------------------+

1 row in set (0.00 sec)

mysql>

Cara Instalasi pada MySQL

gambarnya














Selasa, 23 Maret 2010

Minggu, 14 Maret 2010

TUGAS MYSQL

BAB III

Bekerja dengan Operator dan Fungsi Matematik

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.67-community-nt MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SELECT 10 * 6;

+--------+

| 10 * 6 |

+--------+

| 60 |

+--------+

1 row in set (0.02 sec)

mysql> SELECT 2.5 * 10;

+----------+

| 2.5 * 10 |

+----------+

| 25.0 |

+----------+

1 row in set (0.01 sec)

mysql> SELECT -5 * 10,

-> -5 * 10;

+---------+---------+

| -5 * 10 | -5 * 10 |

+---------+---------+

| -50 | -50 |

+---------+---------+

1 row in set (0.00 sec)

mysql> SELECT (9 / 3) * 2;

+-------------+

| (9 / 3) * 2 |

+-------------+

| 6.0000 |

+-------------+

1 row in set (0.01 sec)

mysql> SELECT 18 / 3;

+--------+

| 18 / 3 |

+--------+

| 6.0000 |

+--------+

1 row in set (0.00 sec)

mysql> SELECT 10 / 0.5;

+----------+

| 10 / 0.5 |

+----------+

| 20.0000 |

+----------+

1 row in set (0.00 sec)

mysql> SELECT 4 + 6;

+-------+

| 4 + 6 |

+-------+

| 10 |

+-------+

1 row in set (0.00 sec)

mysql> SELECT 2 + 4 * 2,

-> ( 2 + 4 ) * 2;

+-----------+---------------+

| 2 + 4 * 2 | ( 2 + 4 ) * 2 |

+-----------+---------------+

| 10 | 12 |

+-----------+---------------+

1 row in set (0.00 sec)

mysql> SELECT 2 + 5 * 3 + 2 ,

-> ( 2 + 5 ) * 3 + 2,

-> ( 2 + 5 ) * ( 3 + 2);

+---------------+-------------------+----------------------+

| 2 + 5 * 3 + 2 | ( 2 + 5 ) * 3 + 2 | ( 2 + 5 ) * ( 3 + 2) |

+---------------+-------------------+----------------------+

| 19 | 23 | 35 |

+---------------+-------------------+----------------------+

1 row in set (0.00 sec)

mysql> SELECT 10 - 6;

+--------+

| 10 - 6 |

+--------+

| 4 |

+--------+

1 row in set (0.02 sec)

mysql> SELECT 6 - 2 + 8,

-> ( 6 - 2 ) + 8 ,

-> 6 - ( 2 + 8 ) ;

+-----------+---------------+---------------+

| 6 - 2 + 8 | ( 6 - 2 ) + 8 | 6 - ( 2 + 8 ) |

+-----------+---------------+---------------+

| 12 | 12 | -4 |

+-----------+---------------+---------------+

1 row in set (0.00 sec)

mysql> SELECT 5 % 2;

+-------+

| 5 % 2 |

+-------+

| 1 |

+-------+

1 row in set (0.00 sec)

mysql> SELECT 7 % 2,7 % 3,

-> 7 % 4, 7 % 5;

+-------+-------+-------+-------+

| 7 % 2 | 7 % 3 | 7 % 4 | 7 % 5 |

+-------+-------+-------+-------+

| 1 | 1 | 3 | 2 |

+-------+-------+-------+-------+

1 row in set (0.00 sec)

mysql> SELECT 7000 / 900, 7000 % 900;

+------------+------------+

| 7000 / 900 | 7000 % 900 |

+------------+------------+

| 7.7778 | 700 |

+------------+------------+

1 row in set (0.00 sec)

mysql> SELECT RADIANS(30),

-> RADIANS(45),

-> RADIANS(60);

+-----------------+------------------+-----------------+

| RADIANS(30) | RADIANS(45) | RADIANS(60) |

+-----------------+------------------+-----------------+

| 0.5235987755983 | 0.78539816339745 | 1.0471975511966 |

+-----------------+------------------+-----------------+

1 row in set (0.03 sec)

mysql> SELECT RADIANS(30),

-> DEGREES(0.5235987755983);

+-----------------+--------------------------+

| RADIANS(30) | DEGREES(0.5235987755983) |

+-----------------+--------------------------+

| 0.5235987755983 | 30 |

+-----------------+--------------------------+

1 row in set (0.00 sec)

mysql> SELECT RADIANS(60),

-> DEGREES(1.0471976611966);

+-----------------+--------------------------+

| RADIANS(60) | DEGREES(1.0471976611966) |

+-----------------+--------------------------+

| 1.0471975511966 | 60.000006302536 |

+-----------------+--------------------------+

1 row in set (0.00 sec)

mysql> SELECT COS(RADIANS(30)),

-> COS(RADIANS(90));

+------------------+----------------------+

| COS(RADIANS(30)) | COS(RADIANS(90)) |

+------------------+----------------------+

| 0.86602540378444 | 6.1230317691119e-017 |

+------------------+----------------------+

1 row in set (0.00 sec)

mysql> SELECT SIN(RADIANS(45)),

-> SIN(RADIANS(60));

+------------------+------------------+

| SIN(RADIANS(45)) | SIN(RADIANS(60)) |

+------------------+------------------+

| 0.70710678118655 | 0.86602540378444 |

+------------------+------------------+

1 row in set (0.00 sec)

mysql> SELECT TAN(RADIANS(30)),

-> TAN(RADIANS(60));

+------------------+------------------+

| TAN(RADIANS(30)) | TAN(RADIANS(60)) |

+------------------+------------------+

| 0.57735026918963 | 1.7320508075689 |

+------------------+------------------+

1 row in set (0.00 sec)

mysql> SELECT ACOS(1),

-> COS(0);

+---------+--------+

| ACOS(1) | COS(0) |

+---------+--------+

| 0 | 1 |

+---------+--------+

1 row in set (0.00 sec)

mysql> SELECT ACOS(0.5),

-> COS(1.0471975511966),

-> COS(RADIANS(60));

+-----------------+----------------------+------------------+

| ACOS(0.5) | COS(1.0471975511966) | COS(RADIANS(60)) |

+-----------------+----------------------+------------------+

| 1.0471975511966 | 0.5 | 0.5 |

+-----------------+----------------------+------------------+

1 row in set (0.00 sec)

mysql> SELECT ASIN(0.5),

-> SIN(0.5235987755983),

-> SIN(RADIANS(30));

+-----------------+----------------------+------------------+

| ASIN(0.5) | SIN(0.5235987755983) | SIN(RADIANS(30)) |

+-----------------+----------------------+------------------+

| 0.5235987755983 | 0.5 | 0.5 |

+-----------------+----------------------+------------------+

1 row in set (0.00 sec)

mysql> SELECT ASIN(1),

-> SIN(1.5707963267949);

+-----------------+----------------------+

| ASIN(1) | SIN(1.5707963267949) |

+-----------------+----------------------+

| 1.5707963267949 | 1 |

+-----------------+----------------------+

1 row in set (0.00 sec)

mysql> SELECT ATAN(0.5),

-> TAN(0.46364760900081);

+------------------+-----------------------+

| ATAN(0.5) | TAN(0.46364760900081) |

+------------------+-----------------------+

| 0.46364760900081 | 0.5 |

+------------------+-----------------------+

1 row in set (0.00 sec)

-> ROUND(2.56);

+-------------+-------------+-------------+-------------+

| ROUND(2.45) | ROUND(2.50) | ROUND(2.51) | ROUND(2.56) |

+-------------+-------------+-------------+-------------+

| 2 | 3 | 3 | 3 |

+-------------+-------------+-------------+-------------+

1 row in set (0.00 sec)

mysql> SELECT ROUND(2.250, 1),

-> ROUND(2.251, 1),

-> ROUND(2.259, 1);

+-----------------+-----------------+-----------------+

| ROUND(2.250, 1) | ROUND(2.251, 1) | ROUND(2.259, 1) |

+-----------------+-----------------+-----------------+

| 2.3 | 2.3 | 2.3 |

+-----------------+-----------------+-----------------+

1 row in set (0.00 sec)

mysql> SELECT ROUND(2.250, 2),

-> ROUND(2.251, 2),

-> ROUND(2.259, 2);

+-----------------+-----------------+-----------------+

| ROUND(2.250, 2) | ROUND(2.251, 2) | ROUND(2.259, 2) |

+-----------------+-----------------+-----------------+

| 2.25 | 2.25 | 2.26 |

+-----------------+-----------------+-----------------+

1 row in set (0.00 sec)

mysql> SELECT ROUND(2.250, 0),

-> ROUND(2.251, 0),

-> ROUND(2.259, 0);

+-----------------+-----------------+-----------------+

| ROUND(2.250, 0) | ROUND(2.251, 0) | ROUND(2.259, 0) |

+-----------------+-----------------+-----------------+

| 2 | 2 | 2 |

+-----------------+-----------------+-----------------+

1 row in set (0.00 sec)

mysql> SELECT CEILING(2.23),

-> CEILING(2.55),

-> CEILING(2.90);

+---------------+---------------+---------------+

| CEILING(2.23) | CEILING(2.55) | CEILING(2.90) |

+---------------+---------------+---------------+

| 3 | 3 | 3 |

+---------------+---------------+---------------+

1 row in set (0.00 sec)

mysql> SELECT CEILING(-2.23),

-> CEILING(-2.55),

-> CEILING(-2.90);

+----------------+----------------+----------------+

| CEILING(-2.23) | CEILING(-2.55) | CEILING(-2.90) |

+----------------+----------------+----------------+

| -2 | -2 | -2 |

+----------------+----------------+----------------+

1 row in set (0.00 sec)

mysql> SELECT CEIL(-1.10) , CEIL(-1.99) ;

+-------------+-------------+

| CEIL(-1.10) | CEIL(-1.99) |

+-------------+-------------+

| -1 | -1 |

+-------------+-------------+

1 row in set (0.00 sec)

mysql> SELECT FLOOR(2.01) ,

-> FLOOR(2.45),

-> FLOOR(2.95);

+-------------+-------------+-------------+

| FLOOR(2.01) | FLOOR(2.45) | FLOOR(2.95) |

+-------------+-------------+-------------+

| 2 | 2 | 2 |

+-------------+-------------+-------------+

1 row in set (0.00 sec)

mysql> SELECT FLOOR(-2.01),

-> FLOOR(-2.45),

-> FLOOR(-2.95);

+--------------+--------------+--------------+

| FLOOR(-2.01) | FLOOR(-2.45) | FLOOR(-2.95) |

+--------------+--------------+--------------+

| -3 | -3 | -3 |

+--------------+--------------+--------------+

1 row in set (0.00 sec)

mysql> SELECT ABS(3),

-> ABS(-3),

-> ABS(-3.34) ;

+--------+---------+------------+

| ABS(3) | ABS(-3) | ABS(-3.34) |

+--------+---------+------------+

| 3 | 3 | 3.34 |

+--------+---------+------------+

1 row in set (0.00 sec)

mysql> SELECT 5 DIV 2,

-> 5 DIV 3,

-> 9 DIV 3;

+---------+---------+---------+

| 5 DIV 2 | 5 DIV 3 | 9 DIV 3 |

+---------+---------+---------+

| 2 | 1 | 3 |

+---------+---------+---------+

1 row in set (0.00 sec)

mysql> SELECT 5 / 2,

-> 5 / 3,

-> 9 / 3;

+--------+--------+--------+

| 5 / 2 | 5 / 3 | 9 / 3 |

+--------+--------+--------+

| 2.5000 | 1.6667 | 3.0000 |

+--------+--------+--------+

1 row in set (0.00 sec)

mysql> SELECT MOD(5.2) ,

-> MOD(5, 3) ,

-> MOD(9, 3) ;

mysql> SELECT MOD(5,2),

-> MOD(5, 3),

-> MOD(9, 3);

+----------+-----------+-----------+

| MOD(5,2) | MOD(5, 3) | MOD(9, 3) |

+----------+-----------+-----------+

| 1 | 2 | 0 |

+----------+-----------+-----------+

1 row in set (0.00 sec)

mysql> SELECT 5 % 22,

-> 5 % 3,

-> 9 % 3;

+--------+-------+-------+

| 5 % 22 | 5 % 3 | 9 % 3 |

+--------+-------+-------+

| 5 | 2 | 0 |

+--------+-------+-------+

1 row in set (0.00 sec)

mysql> SELECT POW(2, 3),

-> POWER(2, 4),

-> POWER(4, 2);

+-----------+-------------+-------------+

| POW(2, 3) | POWER(2, 4) | POWER(4, 2) |

+-----------+-------------+-------------+

| 8 | 16 | 16 |

+-----------+-------------+-------------+

1 row in set (0.03 sec)

mysql> SELECT RAND();

+------------------+

| RAND() |

+------------------+

| 0.15733176111926 |

+------------------+

1 row in set (0.00 sec)

mysql> SELECT RAND(2),

-> RAND(10),

-> RAND(20);

+------------------+------------------+------------------+

| RAND(2) | RAND(10) | RAND(20) |

+------------------+------------------+------------------+

| 0.65558664654902 | 0.65705152196535 | 0.15888261251047 |

+------------------+------------------+------------------+

1 row in set (0.00 sec)

mysql> SELECT SQRT(81);

+----------+

| SQRT(81) |

+----------+

| 9 |

+----------+

1 row in set (0.00 sec)

mysql> SELECT 9 * 9 ;

+-------+

| 9 * 9 |

+-------+

| 81 |

+-------+

1 row in set (0.00 sec)

mysql> SELECT SQRT(4),

-> SQRT(9),

-> SQRT(16),

-> SQRT(25);

+---------+---------+----------+----------+

| SQRT(4) | SQRT(9) | SQRT(16) | SQRT(25) |

+---------+---------+----------+----------+

| 2 | 3 | 4 | 5 |

+---------+---------+----------+----------+

1 row in set (0.00 sec)

mysql> SELECT LEAST(1, 2, 3, 4, 5, 6, 7, 8 , 9);

+-----------------------------------+

| LEAST(1, 2, 3, 4, 5, 6, 7, 8 , 9) |

+-----------------------------------+

| 1 |

+-----------------------------------+

1 row in set (0.03 sec)

mysql> SELECT LEAST(7, 3, 5, 2, 3, 9,8);

+---------------------------+

| LEAST(7, 3, 5, 2, 3, 9,8) |

+---------------------------+

| 2 |

+---------------------------+

1 row in set (0.00 sec)

mysql> SELECT LEAST('E','B','C','F');

+------------------------+

| LEAST('E','B','C','F') |

+------------------------+

| B |

+------------------------+

1 row in set (0.00 sec)

mysql> SELECT GREATEST(1, 2, 3, 4, 5, 6, 7, 8, 9);

+-------------------------------------+

| GREATEST(1, 2, 3, 4, 5, 6, 7, 8, 9) |

+-------------------------------------+

| 9 |

+-------------------------------------+

1 row in set (0.00 sec)

mysql> SELECT GREATEST(7, 3, 5, 2, 3, 9, 8);

+-------------------------------+

| GREATEST(7, 3, 5, 2, 3, 9, 8) |

+-------------------------------+

| 9 |

+-------------------------------+

1 row in set (0.00 sec)

mysql> SELECT GREATEST('E','B','C','F');

+---------------------------+

| GREATEST('E','B','C','F') |

+---------------------------+

| F |

+---------------------------+

1 row in set (0.00 sec)

mysql> SELECT PI();

+----------+

| PI() |

+----------+

| 3.141593 |

+----------+

1 row in set (0.00 sec)

mysql> SELECT TRUNCATE(1.245, 1),

-> TRUNCATE(5.23, 1);

+--------------------+-------------------+

| TRUNCATE(1.245, 1) | TRUNCATE(5.23, 1) |

+--------------------+-------------------+

| 1.2 | 5.2 |

+--------------------+-------------------+

1 row in set (0.00 sec)

mysql> SELECT TRUNCATE(1.245, 2),

-> TRUNCATE(2.459890, 4);

+--------------------+-----------------------+

| TRUNCATE(1.245, 2) | TRUNCATE(2.459890, 4) |

+--------------------+-----------------------+

| 1.24 | 2.4598 |

+--------------------+-----------------------+

1 row in set (0.00 sec)

mysql> SELECT POWER(2, 4),

-> LOG(16);

+-------------+-----------------+

| POWER(2, 4) | LOG(16) |

+-------------+-----------------+

| 16 | 2.7725887222398 |

+-------------+-----------------+

1 row in set (0.00 sec)

mysql> SELECT POWER(2, 7),

-> LOG2(128);

+-------------+-----------+

| POWER(2, 7) | LOG2(128) |

+-------------+-----------+

| 128 | 7 |

+-------------+-----------+

1 row in set (0.00 sec)

mysql> SELECT POWER(2, 4),

-> LOG2(16);

+-------------+----------+

| POWER(2, 4) | LOG2(16) |

+-------------+----------+

| 16 | 4 |

+-------------+----------+

1 row in set (0.00 sec)