Sie sind auf Seite 1von 13

Microsoft Windows XP [Version 5.1.

2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\User>cd\

C:\>cd xampp\mysql\bin

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 1


Server version: 5.1.41 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.
mysql> create database dbperpustakaan;
Query OK, 1 row affected (0.00 sec)

mysql> use dbperpustakaan;


Database changed
mysql> create table member(member_id varchar(5) primary key,
-> nama text not null,
-> hp varchar(12) not null,
-> kota text not null,

-> kode_pos int(6) not null,


-> email text not null,
-> tempat_lahir text not null,
-> tgl_lahir date not null);
Query OK, 0 rows affected (0.03 sec)

mysql> create table buku(id_buku varchar(5) primary key,


-> judul text not null,
-> kat_id smallint(2) not null,
-> id_penulis varchar(5) not null,
-> penerbit text not null,
-> tahun year(4) not null,
-> no_rak tinyint(5) not null,
-> edisi tinyint (3) not null);
Query OK, 0 rows affected (0.01 sec)

mysql> create table penulis(id_penulis varchar(5) primary key,


-> nama varchar(20) not null,
-> kota varchar(10) not null,
-> email text not null,
-> tahun_lahir year(4) not null);
Query OK, 0 rows affected (0.01 sec)

mysql> create table kategori(kat_id int (3) primary key,


-> deskripsi text not null);

Query OK, 0 rows affected (0.01 sec)

mysql> create table rak (no_rak int(2) primary key,


-> lokasi varchar(10) not null);
Query OK, 0 rows affected (0.02 sec)

mysql> create table peminjaman(member_id varchar(5) primary key,


-> book_id varchar (5) not null,
-> tgl_pinjam date not null,
-> tgl_pengembalian date not null,
-> staf_name varchar(25) not null);
Query OK, 0 rows affected (0.02 sec)
mysql> desc member;
+--------------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+--------------+-------------+------+-----+---------+-------+
| member_id

| varchar(5)

| NO

| PRI | NULL

| nama

| text

| NO

| NULL

| hp

| varchar(12) | NO

| NULL

| kota

| text

| NO

| NULL

| kode_pos

| int(6)

| NO

| NULL

| email

| text

| NO

| NULL

| tempat_lahir | text

| NO

| NULL

| tgl_lahir

| NO

| NULL

| date

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

8 rows in set (0.03 sec)


mysql> desc buku;
+------------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+------------+-------------+------+-----+---------+-------+
| id_buku

| varchar(5)

| NO

| PRI | NULL

| judul

| text

| NO

| NULL

| kat_id

| smallint(2) | NO

| NULL

| id_penulis | varchar(5)

| NO

| NULL

| penerbit

| text

| NO

| NULL

| tahun

| year(4)

| NO

| NULL

| no_rak

| tinyint(5)

| NO

| NULL

| edisi

| tinyint(3)

| NO

| NULL

+------------+-------------+------+-----+---------+-------+
8 rows in set (0.00 sec)

mysql> desc penulis;


+-------------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+-------------+-------------+------+-----+---------+-------+
| id_penulis

| varchar(5)

| nama
| kota

| NO

| PRI | NULL

| varchar(20) | NO

| NULL

| varchar(10) | NO

| NULL

| email

| text

| tahun_lahir | year(4)

| NO

| NULL

| NO

| NULL

+-------------+-------------+------+-----+---------+-------+
5 rows in set (0.00 sec)

mysql> desc kategori;


+-----------+--------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+-----------+--------+------+-----+---------+-------+
| kat_id

| int(3) | NO

| deskripsi | text

| NO

| PRI | NULL

| NULL

+-----------+--------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> desc rak;


+--------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+--------+-------------+------+-----+---------+-------+
| no_rak | int(2)

| NO

| lokasi | varchar(10) | NO

| PRI | NULL

| NULL

+--------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> desc peminjaman;


+------------------+-------------+------+-----+---------+------+
| Field

| Type

| Null | Key | Default | Extra|

+------------------+-------------+------+-----+---------+------+
| member_id

| varchar(5)

| NO

| PRI | NULL

| book_id

| varchar(5)

| NO

| NULL

| tgl_pinjam

| date

| NO

| NULL

| tgl_pengembalian | date

| NO

| NULL

| varchar(25) | NO

| NULL

| staf_name

+------------------+-------------+------+-----+---------+------+
5 rows in set (0.00 sec)

mysql>

Microsoft Windows [Version 6.1.7601]


Copyright (c) 2009 Microsoft Corporation.

All rights reserved.

C:\Users\hp>cd\

C:\>cd xampp\mysql\bin

C:\xampp\mysql\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.
Your MySQL connection id is 5

Commands end with ; or \g.

Server version: 5.1.30-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database dbperpustakaan2;


Query OK, 1 row affected (0.01 sec)

mysql> use dbperpustakaan2;


Database changed
mysql> create table member(member_id varchar(5) primary key,
-> nama text not null,
-> hp varchar(12) not null,
-> kota text not null,
-> kode_pos int(6) not null,
-> email text not null,
-> tempat_lahir text not null,
-> tgl_lahir date not null);
Query OK, 0 rows affected (0.06 sec)

mysql> desc member;


+--------------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+--------------+-------------+------+-----+---------+-------+
| member_id

| varchar(5)

| NO

| PRI | NULL

| nama

| text

| NO

| NULL

| hp

| varchar(12) | NO

| NULL

| kota

| text

| NO

| NULL

| kode_pos

| int(6)

| NO

| NULL

| email

| text

| NO

| NULL

| tempat_lahir | text

| NO

| NULL

| tgl_lahir

| NO

| NULL

| date

+--------------+-------------+------+-----+---------+-------+
8 rows in set (0.01 sec)

Microsoft Windows [Version 6.1.7601]


Copyright (c) 2009 Microsoft Corporation.

All rights reserved.

C:\Users\hp>cd\

C:\>cd xampp\mysql\bin

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 5


Server version: 5.1.30-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database dbperpustakaan2;


Query OK, 1 row affected (0.01 sec)

mysql> use dbperpustakaan2;


Database changed
mysql> create table member(member_id varchar(5) primary key,
-> nama text not null,
-> hp varchar(12) not null,
-> kota text not null,
-> kode_pos int(6) not null,
-> email text not null,
-> tempat_lahir text not null,
-> tgl_lahir date not null);
Query OK, 0 rows affected (0.06 sec)

mysql> desc member;


+--------------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+--------------+-------------+------+-----+---------+-------+
| member_id

| varchar(5)

| NO

| PRI | NULL

| nama

| text

| NO

| NULL

| hp

| varchar(12) | NO

| NULL

| kota

| text

| NO

| NULL

| kode_pos

| int(6)

| NO

| NULL

| email

| text

| NO

| NULL

| tempat_lahir | text

| NO

| NULL

| tgl_lahir

| NO

| NULL

| date

+--------------+-------------+------+-----+---------+-------+
8 rows in set (0.01 sec)

Microsoft Windows [Version 6.1.7601]


Copyright (c) 2009 Microsoft Corporation.

C:\Users\hp>cd\

C:\>cd xampp\mysql\bin

All rights reserved.

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 5


Server version: 5.1.30-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database dbperpustakaan2;


Query OK, 1 row affected (0.01 sec)

mysql> use dbperpustakaan2;


Database changed
mysql> create table member(member_id varchar(5) primary key,
-> nama text not null,
-> hp varchar(12) not null,
-> kota text not null,
-> kode_pos int(6) not null,
-> email text not null,
-> tempat_lahir text not null,
-> tgl_lahir date not null);
Query OK, 0 rows affected (0.06 sec)

mysql> desc member;

+--------------+-------------+------+-----+---------+-------+
| Field

| Type

| Null | Key | Default | Extra |

+--------------+-------------+------+-----+---------+-------+
| member_id

| varchar(5)

| NO

| PRI | NULL

| nama

| text

| NO

| NULL

| hp

| varchar(12) | NO

| NULL

| kota

| text

| NO

| NULL

| kode_pos

| int(6)

| NO

| NULL

| email

| text

| NO

| NULL

| tempat_lahir | text

| NO

| NULL

| tgl_lahir

| NO

| NULL

| date

+--------------+-------------+------+-----+---------+-------+
8 rows in set (0.01 sec)

mysql> insert into member values


('M001','ahmad','081364405297','medan','20132','ahmad.junjungan@yahoo.
com','sidikalang','1990-02-11'),
->
('M002','jannes','081364405256','medan','20132','jannes72@yahoo.com','
medan','1972-02-11'),
->
('M003','helpi','08136440345','medan','20132','helpi_simbolon@yahoo.co
.id','sidikalang','1989-02-02'),
->
('M004','rahmat','08136440768','medan','20145','rahmat.sihombing@yahoo
.co.id','siantar','1988-02-04'),

->
('M005','halim','08136405896','medan','20145','halim.sihombing@yahoo.c
o.id','siantar','1988-03-06');
Query OK, 5 rows affected (0.00 sec)
Records: 5

Duplicates: 0

Warnings: 0

mysql> select * from member;


+-----------+--------+--------------+-------+----------+-----------------------------+--------------+------------+
| member_id | nama
| hp
| tempat_lahir | tgl_lahir

| kota

| kode_pos | email

+-----------+--------+--------------+-------+----------+-----------------------------+--------------+------------+
| M001
| ahmad | 081364405297 | medan |
20132 |
ahmad.junjungan@yahoo.com
| sidikalang
| 1990-02-11 |
| M002
| jannes | 081364405256 | medan |
20132 |
jannes72@yahoo.com
| medan
| 1972-02-11 |
| M003
| helpi | 08136440345 | medan |
20132 |
helpi_simbolon@yahoo.co.id
| sidikalang
| 1989-02-02 |
| M004
| rahmat | 08136440768 | medan |
20145 |
rahmat.sihombing@yahoo.co.id | siantar
| 1988-02-04 |
| M005
| halim | 08136405896 | medan |
20145 |
halim.sihombing@yahoo.co.id | siantar
| 1988-03-06 |
+-----------+--------+--------------+-------+----------+-----------------------------+--------------+------------+
5 rows in set (0.00 sec)

mysql>

Das könnte Ihnen auch gefallen