MYSQL


root@localhost>mysql (masuk Mysql)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.77 Source distribution

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

mysql> (tandanya sudah masuk ke halaman mysql)
mysql>SELECT VERSION(), CURRENT_DATE;(untuk melihat versi mysql yang di gunakan)
+———–+————–+
| VERSION() | CURRENT_DATE |
+———–+————–+
| 5.0.77 | 2010-03-20 |
+———–+————–+
1 row in set (0.00 sec)
mysql> SeLeCt vErSiOn(), current_DATE; (atau bisa pakai command yang seperti diasmping )
mysql>select version(), current_date; (kaya gini juga gak apa2 untuk melihat versi yang di gunakan mysqlnya>
mysql>SELECT VERSION(); SELECT NOW(); (sama fungsi buat melihat versi sql>
mysql>SELECT SIN(PI()/4), (4+1)*5; (calculator data base mysql)
+——————+———+
| SIN(PI()/4) | (4+1)*5 |
+——————+———+
| 0.70710678118655 | 25 |
+——————+———+
1 row in set (0.00 sec)
mysql> SHOW DATABASES; (untuk melihat data base yang telah terbuat)

+——————–+
| Database |
+——————–+
| information_schema |
| asep |
| digilib |
| lekar |
| mysql |
| smart |
| test |
+——————–+
7 rows in set (0.07 sec)
mysql>test (untuk belajar data base)
mysql>CREATE DATABASE asep; (cara membuat data base baru)
mysql>USE directurt (untuk menggunakan data base yang telah kita buat)
mysql>CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20), (untuk membuat tabel baru di data base directur tadi)
> species VARCHAR(20), sex CHAR(1), birth DATE, death DATE); (sama yang command ini juga)
mysql> SHOW TABLES;
+———————+
| Tables_in_directurt |
+———————+
| pet |
+———————+
1 row in set (0.00 sec) (ada perbaikan iya kan wkwkw gajebo)
mysql>DESCRIBE pet;
+———+————-+——+—–+———+——-+
| Field | Type | Null | Key | Default | Extra |
+———+————-+——+—–+———+——-+
| name | varchar(20) | YES | | NULL | |
| owner | varchar(20) | YES | | NULL | |
| species | varchar(20) | YES | | NULL | |
| sex | char(1) | YES | | NULL | |
| birth | date | YES | | NULL | |
| death | date | YES | | NULL | |
+———+————-+——+—–+———+——-+
6 rows in set (0.00 sec) (untuk memperjelas isi data base yang ada di file data base pet)
mysql>
mysql>drop database (nama data base) (delete database mysql)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s