System
Manajemen Basis Data
1. Membuat
Database
mysql> create
database sn3_LATIHAN1;
2. Membuat
Tabel
mysql> create
table T_Buku (id_buku varchar(8),nama_buku varchar (50),pengarang
varchar
(50),penerbit varchar(50),harga int(6));
3. Melihat
Isi Tabel
mysql> desc
T_Buku;
+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| id_buku | varchar(8)
| YES | | NULL
| |
| nama_buku |
varchar(50) | YES | | NULL
| |
| pengarang |
varchar(50) | YES | | NULL
| |
| penerbit | varchar(50) | YES | |
NULL | |
| harga | int(6) | YES
| | NULL |
|
+-----------+-------------+------+-----+---------+-------+
4. Menambahkan
Data Pada Tabel
mysql> insert
into T_Buku values ('AA-001','Pemrograman Pascal','Alfred Riedl','
Erlangga','50000');
5. Melihat
Data yang telah diinputkan Pada Tabel
mysql> select
* from T_Buku;
+---------+--------------------+--------------+----------+-------+
| id_buku |
nama_buku | pengarang | penerbit | harga |
+---------+--------------------+--------------+----------+-------+
| AA-001 | Pemrograman Pascal | Alfred Riedl | Erlangga
| 50000 |
| AA-002 | SQL Server | Jono Ricardo | MyBook | 85000 |
| BB-001 | Obati Anti Galau | Tim Galau | Gramedia | 40000 |
| BB-002 | Humor Indonesia | Hendi S | Andi
| 30000 |
+---------+--------------------+--------------+----------+-------+
Tidak ada komentar:
Posting Komentar