Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\sansan>cd/xampp/mysql/bin
C:\xampp\mysql\bin>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.33-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| akademik |
| akademik1 |
| cdcol |
| database_penjualan |
| mysql |
| penjualan |
| phpmyadmin |
| stmik_bansal |
| test |
| webauth |
+--------------------+
11 rows in set (0.00 sec)
mysql> use database_penjualan;
Database changed
mysql> show tables;
Empty set (0.00 sec)
mysql> create table barang(
-> kode_barang char (12),
-> nama_barang varchar (20),
-> kode_suplier char (6),
-> kode_jenis int (11),
-> stock int (4),
-> kode_satuan char (5),
-> kode_lokasi char (5),
-> harga int (8)
-> );
Query OK, 0 rows affected (0.07 sec)
mysql> desc barang;
+--------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| kode_barang | char(12) | YES | | NULL | |
| nama_barang | varchar(20) | YES | | NULL | |
| kode_suplier | char(6) | YES | | NULL | |
| kode_jenis | int(11) | YES | | NULL | |
| stock | int(4) | YES | | NULL | |
| kode_satuan | char(5) | YES | | NULL | |
| kode_lokasi | char(5) | YES | | NULL | |
| harga | int(8) | YES | | NULL | |
+--------------+-------------+------+-----+---------+-------+
8 rows in set (0.01 sec)
mysql> create table suplier(
-> kode_suplier char (6),
-> nama_suplier varchar (20),
-> alamat varchar (50),
-> email varchar (25),
-> no_telepon varchar (15)
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> desc suplier;
+--------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| kode_suplier | char(6) | YES | | NULL | |
| nama_suplier | varchar(20) | YES | | NULL | |
| alamat | varchar(50) | YES | | NULL | |
| email | varchar(25) | YES | | NULL | |
| no_telepon | varchar(15) | YES | | NULL | |
+--------------+-------------+------+-----+---------+-------+
5 rows in set (0.01 sec)
mysql> create table petugas(
-> kode_petugas int null auto_increment key,
-> nama_petugas varchar (20),
-> alamat varchar (50),
-> no_telepon varchar (15),
-> password varchar (9)
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> desc petugas;
+--------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+----------------+
| kode_petugas | int(11) | NO | PRI | NULL | auto_increment |
| nama_petugas | varchar(20) | YES | | NULL | |
| alamat | varchar(50) | YES | | NULL | |
| no_telepon | varchar(15) | YES | | NULL | |
| password | varchar(9) | YES | | NULL | |
+--------------+-------------+------+-----+---------+----------------+
5 rows in set (0.01 sec)
mysql> create table costumer(
-> kode_costumer char (6),
-> nama_costumer varchar (20),
-> alamat varchar (50),
-> no_telepon varchar (15),
-> email varchar (20)
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> desc costumer;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| kode_costumer | char(6) | YES | | NULL | |
| nama_costumer | varchar(20) | YES | | NULL | |
| alamat | varchar(50) | YES | | NULL | |
| no_telepon | varchar(15) | YES | | NULL | |
| email | varchar(20) | YES | | NULL | |
+---------------+-------------+------+-----+---------+-------+
5 rows in set (0.05 sec)
mysql> create table jenis(
-> kode_jenis int null auto_increment key,
-> nama_jenis varchar (10)
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> desc jenis;
+------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+----------------+
| kode_jenis | int(11) | NO | PRI | NULL | auto_increment |
| nama_jenis | varchar(10) | YES | | NULL | |
+------------+-------------+------+-----+---------+----------------+
2 rows in set (0.02 sec)
mysql> create table satuan(
-> kode_satuan char (5),
-> nama_satuan varchar (10)
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> desc satuan;
+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| kode_satuan | char(5) | YES | | NULL | |
| nama_satuan | varchar(10) | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
mysql> create table lokasi(
-> kode_lokasi char (5),
-> nama_lokasi varchar (10)
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> desc lokasi;
+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| kode_lokasi | char(5) | YES | | NULL | |
| nama_lokasi | varchar(10) | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
2 rows in set (0.07 sec)
mysql> create table transaksi(
-> kode_transaksi varchar (15),
-> tanggal date,
-> jam time,
-> kode_costumer char (5),
-> total int (10),
-> kode_petugas char (10)
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> desc transaksi;
+----------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-------------+------+-----+---------+-------+
| kode_transaksi | varchar(15) | YES | | NULL | |
| tanggal | date | YES | | NULL | |
| jam | time | YES | | NULL | |
| kode_costumer | char(5) | YES | | NULL | |
| total | int(10) | YES | | NULL | |
| kode_petugas | char(10) | YES | | NULL | |
+----------------+-------------+------+-----+---------+-------+
6 rows in set (0.01 sec)
mysql> create table detail_transaksi(
-> kode_detail int null auto_increment key,
-> kode_transaksi varchar (15),
-> kode_barang char (12),
-> harga int (10),
-> qty int (4),
-> subtotal int (10)
-> );
Query OK, 0 rows affected (0.05 sec)
mysql> desc detail_transaksi;
+----------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-------------+------+-----+---------+----------------+
| kode_detail | int(11) | NO | PRI | NULL | auto_increment |
| kode_transaksi | varchar(15) | YES | | NULL | |
| kode_barang | char(12) | YES | | NULL | |
| harga | int(10) | YES | | NULL | |
| qty | int(4) | YES | | NULL | |
| subtotal | int(10) | YES | | NULL | |
+----------------+-------------+------+-----+---------+----------------+
6 rows in set (0.01 sec)
0 komentar:
Posting Komentar