Professional Documents
Culture Documents
c:\xampp\mysql\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.16 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights
reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.
mysql> show databases;
mysql> create database pertemuan3;
Query OK, 1 row affected (0.00 sec)
mysql> use pertemuan3;
Database changed
mysql> create table dosen(nip int(6) primary key, nama varchar(20), tanggal
dat
, alamat varchar(20));
Query OK, 0 rows affected (0.17 sec)
mysql> desc dosen;
+---------+-------------+------+-----+---------+-------+
| Field
| Type
| Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| nip
| int(6)
| NO
| PRI | NULL
|
|
| nama
| varchar(20) | YES |
| NULL
|
|
| tanggal | date
| YES |
| NULL
|
|
| alamat | varchar(20) | YES |
| NULL
|
|
+---------+-------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
mysql> insert into dosen values("111222","patarno","1962-02-18","medan"),
-> ("111221","sutarman","1960-03-01","medan"),
-> ("111223","suyanto","1962-01-11","medan"),
-> ("111224","syahriol","1965-12-03","medan");
Query OK, 4 rows affected (0.05 sec)
Records: 4 Duplicates: 0 Warnings: 0
mysql> select * from dosen;
+--------+----------+------------+--------+
| nip
| nama
| tanggal
| alamat |
+--------+----------+------------+--------+
| 111221 | sutarman | 1960-03-01 | medan |
| nip
| int(6)
| NO
| PRI | NULL
|
|
| nama
| varchar(20) | YES |
| NULL
|
|
| tanggal
| date
| YES |
| NULL
|
|
| matakuliah | varchar(15) | YES |
| NULL
|
|
+------------+-------------+------+-----+---------+-------+
5 rows in set (0.00 sec)