You are on page 1of 20

YUNITA SARI 17/416745/SV/14483

Microsoft Windows [Version 10.0.17134.648]

(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\asus>cd . .
C:\Users\asus>cd . .

C:\Users\asus>cd c:\xampp\mysql\bin

c:\xampp\mysql\bin>mysql -u root

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

Your MariaDB connection id is 3

Server version: 10.1.38-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database PET_HEALTH_HISTORY_REPORT;

Query OK, 1 row affected (0.02 sec)

MariaDB [(none)]> USE PET_HEALTH_HISTORY_REPORT;

Database changed

MariaDB [PET_HEALTH_HISTORY_REPORT]> create table HEWAN(PET_ID int(10) NOT NULL,PET_NAME varchar(20) NOT NULL, PET_TYPE
varchar(20) NOT NULL, PET_AGE int(4),OWNER varchar(20) NOT NULL,PRIMARY KEY(PET_ID));
Query OK, 0 rows affected (0.31 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> create table PROSEDUR(PROCEDURE_ID int(10) NOT NULL,PROCEDURE_NAME varchar(20) NOT
NULL,PRIMARY KEY(PROCEDURE_ID));

Query OK, 0 rows affected (2.27 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> create table OWNER(OWNER_ID int(14) NOT NULL, OWNER_NAME varchar(20) NOT NULL, PRIMARY
KEY(OWNER_ID));

Query OK, 0 rows affected (0.19 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> create table KETERANGAN_KUNJUNGAN(VISIT_DATE date NOT NULL,PROCEDURE_ID int(10) NOT
NULL,PET_ID int(10) NOT NULL);

Query OK, 0 rows affected (0.94 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> SHOW TABLES;

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

| Tables_in_pet_health_history_report |

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

| hewan |

| keterangan_kunjungan |

| owner |

| prosedur |
+-------------------------------------+

4 rows in set (0.00 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> DESC HEWAN;

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

| Field | Type | Null | Key | Default | Extra |

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

| PET_ID | int(10) | NO | PRI | NULL | |

| PET_NAME | varchar(20) | NO | | NULL | |

| PET_TYPE | varchar(20) | NO | | NULL | |

| PET_AGE | int(4) | YES | | NULL | |

| OWNER | varchar(20) | NO | | NULL | |

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

5 rows in set (0.01 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into HEWAN(PET_ID,PET_NAME,PET_TYPE,PET_AGE,OWNER)


values('246','ROVER','DOG','12','SAM_COOK');

Query OK, 1 row affected (0.05 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into HEWAN(PET_ID,PET_NAME,PET_TYPE,PET_AGE,OWNER)


values('298','SPOT','DOG','2','TERRY_KIM');
Query OK, 1 row affected (0.07 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into HEWAN(PET_ID,PET_NAME,PET_TYPE,PET_AGE,OWNER)


values('341','MORRIS','CAT','4','SAM_COOK');

Query OK, 1 row affected (0.07 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into HEWAN(PET_ID,PET_NAME,PET_TYPE,PET_AGE,OWNER)


values('519','TWEEDY','BIRD','2','TERRY_KIM');

Query OK, 1 row affected (0.14 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> SELECT*FROM HEWAN;

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

| PET_ID | PET_NAME | PET_TYPE | PET_AGE | OWNER |

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

| 246 | ROVER | DOG | 12 | SAM_COOK |

| 298 | SPOT | DOG | 2 | TERRY_KIM |

| 341 | MORRIS | CAT | 4 | SAM_COOK |

| 519 | TWEEDY | BIRD | 2 | TERRY_KIM |

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

4 rows in set (0.00 sec)


MariaDB [PET_HEALTH_HISTORY_REPORT]> DESC PROSEDUR;

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

| Field | Type | Null | Key | Default | Extra |

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

| PROCEDURE_ID | int(10) | NO | PRI | NULL | |

| PROCEDURE_NAME | varchar(20) | NO | | NULL | |

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

2 rows in set (0.02 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into PROSEDUR(PROCEDURE_ID,PROCEDURE_NAME)values('01','RABIES_VACCINATION');

Query OK, 1 row affected (0.13 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into PROSEDUR(PROCEDURE_ID,PROCEDURE_NAME)values('05','HEART_WORM_TEST');

Query OK, 1 row affected (0.07 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into PROSEDUR(PROCEDURE_ID,PROCEDURE_NAME)values('08','TETANUS_VACCINATION');

Query OK, 1 row affected (0.05 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into PROSEDUR(PROCEDURE_ID,PROCEDURE_NAME)values('10','EXAMINE_and_TREAT');

Query OK, 1 row affected (0.08 sec)


MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into PROSEDUR(PROCEDURE_ID,PROCEDURE_NAME)values('12','EYE_WASH');

Query OK, 1 row affected (0.18 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into PROSEDUR(PROCEDURE_ID,PROCEDURE_NAME)values('20','ANNUAL_CHECK-UP');

Query OK, 1 row affected (0.12 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> SELECT*FROM PROSEDUR;

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

| PROCEDURE_ID | PROCEDURE_NAME |

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

| 1 | RABIES_VACCINATION |

| 5 | HEART_WORM_TEST |

| 8 | TETANUS_VACCINATION |

| 10 | EXAMINE_and_TREAT |

| 12 | EYE_WASH |

| 20 | ANNUAL_CHECK-UP |

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

6 rows in set (0.00 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> DESC OWNER;

+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |

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

| OWNER_ID | int(14) | NO | PRI | NULL | |

| OWNER_NAME | varchar(20) | NO | | NULL | |

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

2 rows in set (0.01 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into OWNER(OWNER_ID,OWNER_NAME)values('1216723412','SAM_COOK');

Query OK, 1 row affected (0.03 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into OWNER(OWNER_ID,OWNER_NAME)values('1367829313','TERRY_KIM');

Query OK, 1 row affected (0.06 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> SELECT*FROM OWNER;

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

| OWNER_ID | OWNER_NAME |

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

| 1216723412 | SAM_COOK |

| 1367829313 | TERRY_KIM |

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

2 rows in set (0.00 sec)


MariaDB [PET_HEALTH_HISTORY_REPORT]> DESC KETERANGAN_KUNJUNGAN;

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

| Field | Type | Null | Key | Default | Extra |

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

| VISIT_DATE | date | NO | | NULL | |

| PROCEDURE_ID | int(10) | NO | | NULL | |

| PET_ID | int(10) | NO | | NULL | |

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

3 rows in set (0.01 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into


KETERANGAN_KUNJUNGAN(VISIT_DATE,PROCEDURE_ID,PET_ID)values('20010123','01','341');

Query OK, 1 row affected (0.06 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into


KETERANGAN_KUNJUNGAN(VISIT_DATE,PROCEDURE_ID,PET_ID)values('20020113','01','246');

Query OK, 1 row affected (0.06 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into


KETERANGAN_KUNJUNGAN(VISIT_DATE,PROCEDURE_ID,PET_ID)values('20020113','01','341');

Query OK, 1 row affected (0.13 sec)


MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into
KETERANGAN_KUNJUNGAN(VISIT_DATE,PROCEDURE_ID,PET_ID)values('20020121','08','298');

Query OK, 1 row affected (0.10 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into


KETERANGAN_KUNJUNGAN(VISIT_DATE,PROCEDURE_ID,PET_ID)values('20020310','05','298');

Query OK, 1 row affected (0.07 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into


KETERANGAN_KUNJUNGAN(VISIT_DATE,PROCEDURE_ID,PET_ID)values('20020327','10','246');

Query OK, 1 row affected (0.07 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into


KETERANGAN_KUNJUNGAN(VISIT_DATE,PROCEDURE_ID,PET_ID)values('20020402','05','246');

Query OK, 1 row affected (0.07 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into


KETERANGAN_KUNJUNGAN(VISIT_DATE,PROCEDURE_ID,PET_ID)values('20020430','20','519');

Query OK, 1 row affected (0.20 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> insert into


KETERANGAN_KUNJUNGAN(VISIT_DATE,PROCEDURE_ID,PET_ID)values('20020430','12','519');
Query OK, 1 row affected (0.08 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> SELECT*FROM KETERANGAN_KUNJUNGAN;

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

| VISIT_DATE | PROCEDURE_ID | PET_ID |

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

| 2001-01-23 | 1 | 341 |

| 2002-01-13 | 1 | 246 |

| 2002-01-13 | 1 | 341 |

| 2002-01-21 | 8 | 298 |

| 2002-03-10 | 5 | 298 |

| 2002-03-27 | 10 | 246 |

| 2002-04-02 | 5 | 246 |

| 2002-04-30 | 20 | 519 |

| 2002-04-30 | 12 | 519 |

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

9 rows in set (0.00 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> SELECT*FROM HEWAN;

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

| PET_ID | PET_NAME | PET_TYPE | PET_AGE | OWNER |


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

| 246 | ROVER | DOG | 12 | SAM_COOK |

| 298 | SPOT | DOG | 2 | TERRY_KIM |

| 341 | MORRIS | CAT | 4 | SAM_COOK |

| 519 | TWEEDY | BIRD | 2 | TERRY_KIM |

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

4 rows in set (0.00 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> SELECT*FROM PROSEDUR;

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

| PROCEDURE_ID | PROCEDURE_NAME |

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

| 1 | RABIES_VACCINATION |

| 5 | HEART_WORM_TEST |

| 8 | TETANUS_VACCINATION |

| 10 | EXAMINE_and_TREAT |

| 12 | EYE_WASH |

| 20 | ANNUAL_CHECK-UP |

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

6 rows in set (0.00 sec)


MariaDB [PET_HEALTH_HISTORY_REPORT]> SELECT*FROM OWNER;

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

| OWNER_ID | OWNER_NAME |

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

| 1216723412 | SAM_COOK |

| 1367829313 | TERRY_KIM |

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

2 rows in set (0.00 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> SELECT*FROM KETERANGAN_KUNJUNGAN;

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

| VISIT_DATE | PROCEDURE_ID | PET_ID |

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

| 2001-01-23 | 1 | 341 |

| 2002-01-13 | 1 | 246 |

| 2002-01-13 | 1 | 341 |

| 2002-01-21 | 8 | 298 |

| 2002-03-10 | 5 | 298 |

| 2002-03-27 | 10 | 246 |

| 2002-04-02 | 5 | 246 |

| 2002-04-30 | 20 | 519 |
| 2002-04-30 | 12 | 519 |

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

9 rows in set (0.00 sec)

MariaDB [PET_HEALTH_HISTORY_REPORT]> exit

Bye

c:\xampp\mysql\bin>mysqldump -uroot PET_HEALTH_HISTORY_REPORT>D:\14483_PBASDAT.sql

c:\xampp\mysql\bin>