TUGAS MODUL 1
1.    Membuat Table bernama ‘event’
Membuat database pethouse terlebih dahulu caranya:
mysql> create database pethouse;
Query OK, 1 row affected (0.00 sec)
Menggunakan database pethouse
mysql> use pethouse;
Database changed
Membuat Tabel bernama event
mysql> create table event(name varchar(20),date date,type varchar(15),remark varchar(255));
Query OK, 0 rows affected (1.00 sec)
Melihat deskripsi table event
mysql> desc event;
+--------+--------------+------+-----+---------+-------+
| Field  | Type         | Null | Key | Default | Extra |
+--------+--------------+------+-----+---------+-------+
| name   | varchar(20)  | YES  |     | NULL    |       |
| date   | date         | YES  |     | NULL    |       |
| type   | varchar(15)  | YES  |     | NULL    |       |
| remark | varchar(255) | YES  |     | NULL    |       |
+--------+--------------+------+-----+---------+-------+
4 rows in set (0.06 sec)

Screen shot :





2.    Mengisikan data table dengan insert
mysql> insert into event values('Fluffy','1995-05-15','litter','4 kittens, 3 female, 1 male');
Query OK, 1 row affected (0.05 sec)
mysql> insert into event values('Buffy','1993-06-23','litter','5 puppies, 2 female, 3 male');
Query OK, 1 row affected (0.05 sec)

mysql> insert into event values('Buffy','1994-06-19','litter','3 puppies, 3 female');
Query OK, 1 row affected (0.00 sec)
mysql> insert into event values('Chirpy','1999-03-21','vet','needed beak straightened');
Query OK, 1 row affected (0.03 sec)
Screen shot :

 

 
3.    Mengisikan data table dengan LOAD DATA
mysql> load data local infile 'D://IST AKPRIND/SEMESTER - 5/Sistem Manajemen Basis Data/Tugas/Tugas-2/insert1.txt' into table event;
Query OK, 6 rows affected, 6 warnings (0.00 sec)
Records: 6  Deleted: 0  Skipped: 0  Warnings: 6
4.    Menampilkan data yang sudah dibuat dengan SELECT
mysql> select*from event;




 





0 komentar to "Tugas 2 - Modul 1 - Sistem Manajemen Basis Dara dengan MySQL"

Posting Komentar