Flavianus Dui Saverino Rahim - 13.2020.1.00964 - 6

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

C:\Users\SvR>cd\

C:\>cd xampp

C:\xampp>cd mysql

C:\xampp\mysql>cd bin

C:\xampp\mysql\bin>mysql -u root -p

Enter password:

Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MariaDB connection id is 291

Server version: 10.4.22-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database modul3;

Query OK, 1 row affected (0.002 sec)

MariaDB [(none)]> use modul3;

Database changed

MariaDB [modul3]> create table customer (id_customer int, nama_customer varchar(100), alamat
varchar(200), no_telp int);

Query OK, 0 rows affected (0.217 sec)

MariaDB [modul3]> alter table customer

-> add primary key (id_customer);

Query OK, 0 rows affected (0.480 sec)

Records: 0 Duplicates: 0 Warnings: 0


MariaDB [modul3]> alter table customer

-> modify id_customer varchar(2);

Query OK, 1 row affected (0.905 sec)

Records: 1 Duplicates: 0 Warnings: 0

MariaDB [modul3]> insert into customer (id_customer, nama_customer, alamat, no_telp) values ('c1',
'ucup', 'kedinding', 081234567891), ('c2', 'alfin', 'bulak banteng', 087639458126), ('c3', 'ajes', 'gubeng',
085283740128);

Query OK, 1 row affected, 1 warning (0.049 sec)

MariaDB [modul3]> create table kategori (id_kategori varchar(2), nama_kategori varchar(100));

Query OK, 0 rows affected (0.278 sec)

MariaDB [modul3]> alter table kategori

-> add primary key (id_kategori);

Query OK, 0 rows affected (0.501 sec)

Records: 0 Duplicates: 0 Warnings: 0

MariaDB [modul3]> insert into kategori (id_kategori,nama_kategori) values ('k1', 'katun'),


(id_kategori,nama_kategori) values ('k2', 'linen'), ('k3', 'denim');

Query OK, 1 row affected (0.153 sec)

MariaDB [modul3]> create table supplier (id_supplier varchar(2), nama_supplier varchar(100),


alamat_supplier varchar(200));

Query OK, 0 rows affected (0.224 sec)

MariaDB [modul3]> alter table supplier

-> add primary key (id_supplier);

Query OK, 0 rows affected (0.490 sec)


Records: 0 Duplicates: 0 Warnings: 0

MariaDB [modul3]> insert into supplier (id_supplier,nama_supplier,alamat_supplier) values ('c1', 'teguh


karya', 'kenjeran'), ('c2', 'kain jaya', 'rungkut');

Query OK, 2 rows affected (0.091 sec)

Records: 2 Duplicates: 0 Warnings: 0

MariaDB [modul3]> create table pegawai (id_pegawai varchar(2), nama_pegawai varchar(100),


alamat_pegawai varchar(200), telp_pegawai int, tanggal_lahir varchar(15));

Query OK, 0 rows affected (0.285 sec)

MariaDB [modul3]> alter table pegawai

-> add primary key (id_pegawai);

Query OK, 0 rows affected (0.403 sec)

Records: 0 Duplicates: 0 Warnings: 0

MariaDB [modul3]> insert into pegawai (id_pegawai,


nama_pegawai,alamat_pegawai,telp_pegawai ,tanggal_lahir) values ('p1', 'alfira', 'kebonsari',
081898476265, '12/06/1990'), ('p2', 'innama', 'tunjungan', 085890652896, '17/10/1992'), ('p3', 'cindy',
'tanah merah', 089727062896, '10/11/1994');

Query OK, 3 rows affected, 3 warnings (0.041 sec)

Records: 3 Duplicates: 0 Warnings: 3

You might also like