Senin, 19 Juli 2010

jaringan komputer mulai dari tipe jaringan, hardware&software yang dibutuhkan, installasi jaringan dan 7 lapisan jaringan

Jaringan komputer adalah sebuah sistem yang terdiri atas komputer dan perangkat jaringan lainnya yang bekerja bersama-sama untuk mencapai suatu tujuan yang sama. Tujuan dari jaringan komputer adalah:

Agar dapat mencapai tujuan yang sama, setiap bagian dari jaringan komputer meminta dan memberikan layanan (service). Pihak yang meminta layanan disebut klien (client) dan yang memberikan layanan disebut pelayan (server). Arsitektur ini disebut dengan sistem client-server, dan digunakan pada hampir seluruh aplikasi jaringan komputer.

Klasifikasi

Berdasarkan skala :

  • Personal Area Network (PAN)
  • Campus Area Network (CAN)
  • Local Area Network (LAN): suatu jaringan komputer yang menghubungkan suatu komputer dengan komputer lain dengan jarak yang terbatas.
  • Metropolitant Area Network (MAN): prinsip sama dengan LAN, hanya saja jaraknya lebih luas, yaitu 10-50 km.
  • Wide Area Network (WAN): jaraknya antar kota, negara, dan benua. ini sama dengan internet.
  • Global Area Network (GAN)

Berdasarkan fungsi : Pada dasarnya setiap jaringan komputer ada yang berfungsi sebagai client dan juga server. Tetapi ada jaringan yang memiliki komputer yang khusus didedikasikan sebagai server sedangkan yang lain sebagai client. Ada juga yang tidak memiliki komputer yang khusus berfungsi sebagai server saja. Karena itu berdasarkan fungsinya maka ada dua jenis jaringan komputer:

  • Client-server
    Yaitu jaringan komputer dengan komputer yang didedikasikan khusus sebagai server. Sebuah service/layanan bisa diberikan oleh sebuah komputer atau lebih. Contohnya adalah sebuah domain seperti www.detik.com yang dilayani oleh banyak komputer web server. Atau bisa juga banyak service/layanan yang diberikan oleh satu komputer. Contohnya adalah server jtk.polban.ac.id yang merupakan satu komputer dengan multi service yaitu mail server, web server, file server, database server dan lainnya.
  • Peer-to-peer
    Yaitu jaringan komputer dimana setiap host dapat menjadi server dan juga menjadi client secara bersamaan. Contohnya dalam file sharing antar komputer di Jaringan Windows Network Neighbourhood ada 5 komputer (kita beri nama A,B,C,D dan E) yang memberi hak akses terhadap file yang dimilikinya. Pada satu saat A mengakses file share dari B bernama data_nilai.xls dan juga memberi akses file soal_uas.doc kepada C. Saat A mengakses file dari B maka A berfungsi sebagai client dan saat A memberi akses file kepada C maka A berfungsi sebagai server. Kedua fungsi itu dilakukan oleh A secara bersamaan maka jaringan seperti ini dinamakan peer to peer.

Berdasarkan topologi jaringan, jaringan komputer dapat dibedakan atas:

Berdasarkan kriterianya, jaringan komputer dibedakan menjadi 4 yaitu:

  1. Berdasarkan distribusi sumber informasi/data
    • Jaringan terpusat
      Jaringan ini terdiri dari komputer klient dan server yang mana komputer klient yang berfungsi sebagai perantara untuk mengakses sumber informasi/data yang berasal dari satu komputer server
    • Jaringan terdistribusi
      Merupakan perpaduan beberapa jaringan terpusat sehingga terdapat beberapa komputer server yang saling berhubungan dengan klient membentuk sistem jaringan tertentu.
  2. Berdasarkan jangkauan geografis dibedakan menjadi:
    • Jaringan LAN
      merupakan jaringan yang menghubungkan 2 komputer atau lebih dalam cakupan seperti laboratorium, kantor, serta dalam 1 warnet.
    • Jaringan MAN
      Merupakan jaringan yang mencakup satu kota besar beserta daerah setempat. Contohnya jaringan telepon lokal, sistem telepon seluler, serta jaringan relay beberapa ISP internet.
    • Jaringan WAN
      Merupakan jaringan dengan cakupan seluruh dunia. Contohnya jaringan PT Telkom, PT. Indosat, serta jaringan GSM Seluler seperti Satelindo, Telkomsel, dan masih banyak lagi.
  3. Berdasarkan peranan dan hubungan tiap komputer dalam memproses data.
    • Jaringan Client-Server
      Pada jaringan ini terdapat 1 atau beberapa komputer server dan komputer client. Komputer yang akan menjadi komputer server maupun menjadi komputer client dan diubah-ubah melalui software jaringan pada protokolnya. Komputer client sebagai perantara untuk dapat mengakses data pada komputer server sedangkan komputer server menyediakan informasi yang diperlukan oleh komputer client.
    • Jaringan Peer-to-peer
      Pada jaringan ini tidak ada komputer client maupun komputer server karena semua komputer dapat melakukan pengiriman maupun penerimaan informasi sehingga semua komputer berfungsi sebagai client sekaligus sebagai server.
  4. Berdasarkan media transmisi data
    • Jaringan Berkabel (Wired Network)
      Pada jaringan ini, untuk menghubungkan satu komputer dengan komputer lain diperlukan penghubung berupa kabel jaringan. Kabel jaringan berfungsi dalam mengirim informasi dalam bentuk sinyal listrik antar komputer jaringan.
    • Jaringan Nirkabel(WI-FI)
      Merupakan jaringan dengan medium berupa gelombang elektromagnetik. Pada jaringan ini tidak diperlukan kabel untuk menghubungkan antar komputer karena menggunakan gelombang elektromagnetik yang akan mengirimkan sinyal informasi antar komputer jaringan.

Rabu, 14 April 2010

TUGAS SQL 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>

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)