Professional Documents
Culture Documents
Tugas2ddl 12181007
Tugas2ddl 12181007
C:\Users\USER>cd c:\
c:\>"xampp\mysql\bin\mysql.exe" -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 74
Server version: 10.1.30-MariaDB mariadb.org binary distribution
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
9. Buat field baru pada tabel pasien, yaitu, �tgl_lahir� dengan type = "date"
MariaDB [puskesmas]> alter table pasien
-> add tgl_lahir date;
Query OK, 0 rows affected (0.48 sec)
Records: 0 Duplicates: 0 Warnings: 0
11. Buat field baru pada tabel komik, yaitu, �no_telp� dengan type = �varchar� dan
size = �15�.
MariaDB [puskesmas]> alter table pasien
-> add no_telp varchar(15);
Query OK, 0 rows affected (0.45 sec)
Records: 0 Duplicates: 0 Warnings: 0
12. Tampilkan struktur tabel pasien.
MariaDB [puskesmas]> desc pasien;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| id_pasien | varchar(5) | NO | PRI | NULL | |
| nama_pasien | varchar(40) | YES | | NULL | |
| jenis_kelamin | varchar(1) | YES | | NULL | |
| alamat | varchar(30) | YES | | NULL | |
| tgl_lahir | date | YES | | NULL | |
| no_telp | varchar(15) | YES | | NULL | |
+---------------+-------------+------+-----+---------+-------+
6 rows in set (0.02 sec)
18. Beri Primary Key pada field �id_dokter� pada tabel dokter.
MariaDB [puskesmas]> alter table dokter
-> add primary key(id_dokter);
Query OK, 0 rows affected (0.43 sec)
Records: 0 Duplicates: 0 Warnings: 0
29. Buat field baru pada tabel komik, yaitu, �tgl_masuk� dengan type = �date�.
MariaDB [puskesmas]> alter table kamar_pasien
-> add tgl_masuk date;
Query OK, 0 rows affected (0.44 sec)
Records: 0 Duplicates: 0 Warnings: 0
c:\>