Senin, 19 Agustus 2019

MEMBUAT TABEL

MariaDB [(none)]> create database if not exists toko;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> use toko;
Database changed

MariaDB [toko]> CREATE TABLE satuan (
    -> satuanId INT NOT NULL AUTO_INCREMENT,
    -> satuanNama VARCHAR(30) NOT NULL,
    -> PRIMARY KEY (satuanId));
Query OK, 0 rows affected (0.37 sec)

MariaDB [toko]> describe satuan;



MariaDB [toko]> create table supplier(
    -> supplierId INT NOT NULL AUTO_INCREMENT,
    -> supplierNama VARCHAR(50) NOT NULL,
    -> supplierAlamat TEXT,
    -> PRIMARY KEY (supplierId));
Query OK, 0 rows affected (0.36 sec)



MariaDB [toko]> create table cabang(
    -> cabangId INT(11) NOT NULL AUTO_INCREMENT,
    -> cabangNama VARCHAR(50) NOT NULL,
    -> canagAlamat TEXT,
    -> PRIMARY KEY(cabangId));
Query OK, 0 rows affected (0.53 sec)




Untuk menghapus table :
MariaDB [toko]> drop table jumlah;
Query OK, 0 rows affected (0.25 sec)

0 komentar:

Posting Komentar