You are on page 1of 17

Microsoft Windows [Version 10.0.19044.

1766]
(c) Microsoft Corporation. All rights reserved.

C:\Users\LAPTOPSMKN4>cd c:\

c:\>"xampp/mysql/bin/mysql.exe" -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 511
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 toko_baju;


Query OK, 1 row affected (0.002 sec)

MariaDB [(none)]> use database toko_baju;


ERROR 1049 (42000): Unknown database 'database'
MariaDB [(none)]> use toko_baju;
Database changed
MariaDB [toko_baju]> create table stok
-> (kode_produk char(4) PRIMARY key,
-> nama_produk varchar(20),
-> size varchar(5),
-> jumlah int(4),
-> harga double);
Query OK, 0 rows affected (0.268 sec)

MariaDB [toko_baju]> show tables;


+---------------------+
| Tables_in_toko_baju |
+---------------------+
| stok |
+---------------------+
1 row in set (0.001 sec)

MariaDB [toko_baju]> desc stok;


+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| kode_produk | char(4) | NO | PRI | NULL | |
| nama_produk | varchar(20) | YES | | NULL | |
| size | varchar(5) | YES | | NULL | |
| jumlah | int(4) | YES | | NULL | |
| harga | double | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
5 rows in set (0.088 sec)

MariaDB [toko_baju]> insert into stok


-> (kode_produk,nama_produk,size,jumlah,harga)
-> values
-> ('N111','NIKE SPORTWEAR PREMIUM','L','40','349000'),
-> ('M94','MANCHASTER UNITED JERSEY','XXL','150000'),
-> ('M94','MANCHASTER UNITED JERSEY','XXL','150000');
ERROR 1136 (21S01): Column count doesn't match value count at row 2
MariaDB [toko_baju]> insert into stok
-> (kode_produk,nama_produk,size,jumlah,harga)
-> values
-> ('N111','NIKE SPORTWEAR PREMIUM','L','40','349000'),
-> ('M94','MANCHASTER UNITED JERSEY','XXL','20'150000');
'> '
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
'150000');
'' at line 5
MariaDB [toko_baju]> insert into stok
-> (kode_produk,nama_produk,size,jumlah,harga)
-> values
-> ('N111','NIKE SPORTWEAR PREMIUM','L','40','349000'),
-> ('M94','MANCHASTER UNITED JERSEY','XXL','20','150000'),
-> ('N110','NIKE SPORTWEAR MAX 90','M','50','300000'),
-> ('A34','ADIDAS TSHIRT FULL RED','L','34','250000'),
-> ('A32','ADIDAS TSHIRT FULL WHITE','L','44','250000'),
-> ('N122','NIKE HOODIE','S','56','400000');
Query OK, 6 rows affected, 5 warnings (0.127 sec)
Records: 6 Duplicates: 0 Warnings: 5

MariaDB [toko_baju]> DESC STOK;


+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| kode_produk | char(4) | NO | PRI | NULL | |
| nama_produk | varchar(20) | YES | | NULL | |
| size | varchar(5) | YES | | NULL | |
| jumlah | int(4) | YES | | NULL | |
| harga | double | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
5 rows in set (0.019 sec)

MariaDB [toko_baju]> SELECT*FROM STOK;


+-------------+----------------------+------+--------+--------+
| kode_produk | nama_produk | size | jumlah | harga |
+-------------+----------------------+------+--------+--------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 150000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 |
| N122 | NIKE HOODIE | S | 56 | 400000 |
+-------------+----------------------+------+--------+--------+
6 rows in set (0.015 sec)

MariaDB [toko_baju]> create table kasir


-> (no_kasir char(3) not null,
-> no_telp varchar(15) not null,
-> alamat varchar(50) not null,
-> primary key(no_kasir));
Query OK, 0 rows affected (0.255 sec)

MariaDB [toko_baju]> insert into kasir


-> (no_kasir,nama^Z);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near '→)' at
line 2
MariaDB [toko_baju]> drop table kasir;
Query OK, 0 rows affected (0.325 sec)
MariaDB [toko_baju]> create table kasir
-> (no_kasir char(3) not null,
-> nama varchar(35) not null,
-> no_telp varchar(15) not null,
-> alamat varchar(50) not null,
-> primary key(no_kasir));
Query OK, 0 rows affected (0.262 sec)

MariaDB [toko_baju]> insert into kasir


-> (no_kasir,nama,no_telp,alamat)
-> values
-> ('A01','SAFFRUDIN','081567677878','Kota Paris'),
-> ('A02','DODI MULYONO','085829293030','Cisaat'),
-> ('A03','AYU ALMANDA','081289892727','Cemerlang');
Query OK, 3 rows affected (0.196 sec)
Records: 3 Duplicates: 0 Warnings: 0

MariaDB [toko_baju]> select*from kasir;


+----------+--------------+--------------+------------+
| no_kasir | nama | no_telp | alamat |
+----------+--------------+--------------+------------+
| A01 | SAFFRUDIN | 081567677878 | Kota Paris |
| A02 | DODI MULYONO | 085829293030 | Cisaat |
| A03 | AYU ALMANDA | 081289892727 | Cemerlang |
+----------+--------------+--------------+------------+
3 rows in set (0.000 sec)

MariaDB [toko_baju]> create table penjualan


-> (id_penjualan int(5) primary key,
-> no_kasir char(3) not null,
-> kode_produk char(4) not null,
-> tgl_penjualan date not null,
-> harga double not null,
-> jumlah_beli int(4) not null,
-> total_harga double not null);
Query OK, 0 rows affected (0.255 sec)

MariaDB [toko_baju]> insert into penjualan


->
(id_penjualan,no_kasir,kode_produk,tgl_penjualan,harga,jumlah_beli,total_harga)
-> values
-> ('01001','A02','A34','18-JUNI-2022','250000','2','500000');
Query OK, 1 row affected, 1 warning (0.100 sec)

MariaDB [toko_baju]> Select*from penjualan;


+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1001 | A02 | A34 | 0000-00-00 | 250000 | 2 |
500000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
1 row in set (0.000 sec)

MariaDB [toko_baju]> Select*from penjualan;


Empty set (0.000 sec)

MariaDB [toko_baju]> insert into penjualan


->
(id_penjualan,no_kasir,kode_produk,tgl_penjualan,harga,jumlah_beli,total_harga)
-> values
-> ('01001','A02','A34','2022-04-18','250000','2','500000');
Query OK, 1 row affected (0.060 sec)

MariaDB [toko_baju]> Select*from penjualan;


+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1001 | A02 | A34 | 2022-04-18 | 250000 | 2 |
500000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
1 row in set (0.000 sec)

MariaDB [toko_baju]> insert into penjualan


->
(id_penjualan,no_kasir,kode_produk,tgl_penjualan,harga,jumlah_beli,total_harga)
-> values
-> ('01001','A02','A34','2022-05-22','250000','2','500000'),
-> ('01002','A02','M94','2022-05-22','150000','3','750000'),
-> ('01003','A03','N110','2022-05-24','300000','4','1200000'),
-> ('01004','104','N122','2022-06-01','400000','10','4000000'),
-> values;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
'values' at line 8
MariaDB [toko_baju]> insert into penjualan
->
(id_penjualan,no_kasir,kode_produk,tgl_penjualan,harga,jumlah_beli,total_harga)
-> values
-> ('01001','A02','A34','2022-05-22','250000','2','500000'),
-> ('01002','A02','M94','2022-05-22','150000','3','750000'),
-> ('01003','A03','N110','2022-05-24','300000','4','1200000'),
-> ('01004','A04','N122','2022-06-01','400000','10','4000000'),
-> ('01005','A04','A34','2022-06-02','250000','4','1000000'),
-> ('01006','A04','N122','2022-06-03','400000','2','800000');''
Query OK, 6 rows affected (0.107 sec)
Records: 6 Duplicates: 0 Warnings: 0

-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near '''' at
line 1
MariaDB [toko_baju]> SELECT*FROM PENJUALAN;
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1001 | A02 | A34 | 2022-05-22 | 250000 | 2 |
500000 |
| 1002 | A02 | M94 | 2022-05-22 | 150000 | 3 |
750000 |
| 1003 | A03 | N110 | 2022-05-24 | 300000 | 4 |
1200000 |
| 1004 | A04 | N122 | 2022-06-01 | 400000 | 10 |
4000000 |
| 1005 | A04 | A34 | 2022-06-02 | 250000 | 4 |
1000000 |
| 1006 | A04 | N122 | 2022-06-03 | 400000 | 2 |
800000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
6 rows in set (0.000 sec)

MariaDB [toko_baju]> show tables;


+---------------------+
| Tables_in_toko_baju |
+---------------------+
| kasir |
| penjualan |
| stok |
+---------------------+
3 rows in set (0.001 sec)

MariaDB [toko_baju]> select*from kasir;


+----------+--------------+--------------+------------+
| no_kasir | nama | no_telp | alamat |
+----------+--------------+--------------+------------+
| A01 | SAFFRUDIN | 081567677878 | Kota Paris |
| A02 | DODI MULYONO | 085829293030 | Cisaat |
| A03 | AYU ALMANDA | 081289892727 | Cemerlang |
+----------+--------------+--------------+------------+
3 rows in set (0.000 sec)

MariaDB [toko_baju]> select*from penjualan;


+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1001 | A02 | A34 | 2022-05-22 | 250000 | 2 |
500000 |
| 1002 | A02 | M94 | 2022-05-22 | 150000 | 3 |
750000 |
| 1003 | A03 | N110 | 2022-05-24 | 300000 | 4 |
1200000 |
| 1004 | A04 | N122 | 2022-06-01 | 400000 | 10 |
4000000 |
| 1005 | A04 | A34 | 2022-06-02 | 250000 | 4 |
1000000 |
| 1006 | A04 | N122 | 2022-06-03 | 400000 | 2 |
800000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
6 rows in set (0.001 sec)

MariaDB [toko_baju]> select*from stok;


+-------------+----------------------+------+--------+--------+
| kode_produk | nama_produk | size | jumlah | harga |
+-------------+----------------------+------+--------+--------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 150000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 |
| N122 | NIKE HOODIE | S | 56 | 400000 |
+-------------+----------------------+------+--------+--------+
6 rows in set (0.000 sec)

MariaDB [toko_baju]> insert into kasir


-> (no_kasir,nama,no_telp,alamat)
-> values
-> ('A04','DARA AISYAH','085690908888'),
-> ('A05','GHAFUR SEPTIAN','081245457777');
ERROR 1136 (21S01): Column count doesn't match value count at row 1
MariaDB [toko_baju]> insert into kasir
-> values
-> ('A04','DARA AISYAH','085690908888'),
-> ('A05','GHAFUR SEPTIAN','081245457777');
ERROR 1136 (21S01): Column count doesn't match value count at row 1
MariaDB [toko_baju]> insert into kasir values
-> ('A04','DARA AISYAH','085690908888');
ERROR 1136 (21S01): Column count doesn't match value count at row 1
MariaDB [toko_baju]> select*fromBye
Ctrl-C -- exit!

c:\>"xampp/mysql/bin/mysql.exe" -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 698
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)]> use toko_baju;


Database changed
MariaDB [toko_baju]> insert into kasir
-> values
-> ('A04','DARA AISYAH','085690908888'),
-> ('A05','GHAFUR SEPTIAN','081245457777');
ERROR 1136 (21S01): Column count doesn't match value count at row 1
MariaDB [toko_baju]> insert into penjualan
->
(id_penjualan,no_kasir,kode_produk,tgl_penjualan,harga,jumlah_beli,total_harga)
-> values
-> ('01001','A02','A34','2022-05-22','250000','2','500000'),
-> ('01002','A02','M94','2022-05-22','150000','3','750000'),
-> ('01003','A01','N110','2022-05-24','300000','4','1200000'),
-> ('01004','A01','N122','2022-06-01','400000','10','4000000'),
-> ('01005','A02','A34','2022-06-02','250000','4','1000000'),
-> ('01006','A02','N122','2022-06-03','400000','2','800000');
Query OK, 6 rows affected (0.075 sec)
Records: 6 Duplicates: 0 Warnings: 0

MariaDB [toko_baju]> select*from penjualan;


+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1001 | A02 | A34 | 2022-05-22 | 250000 | 2 |
500000 |
| 1002 | A02 | M94 | 2022-05-22 | 150000 | 3 |
750000 |
| 1003 | A01 | N110 | 2022-05-24 | 300000 | 4 |
1200000 |
| 1004 | A01 | N122 | 2022-06-01 | 400000 | 10 |
4000000 |
| 1005 | A02 | A34 | 2022-06-02 | 250000 | 4 |
1000000 |
| 1006 | A02 | N122 | 2022-06-03 | 400000 | 2 |
800000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
6 rows in set (0.000 sec)

MariaDB [toko_baju]> DELETE FROM kasir where no_kasir='A04';


Query OK, 0 rows affected (0.000 sec)

MariaDB [toko_baju]> insert into penjualan


->
(id_penjualan,no_kasir,kode_produk,tgl_penjualan,harga,jumlah_beli,total_harga)
-> values
-> ('01001','A01','A34','2022-05-22','250000','2','500000'),
-> ('01002','A01','M94','2022-05-22','150000','3','750000'),
-> ('01003','A01','N110','2022-05-24','300000','4','1200000'),
-> ('01004','A01','N122','2022-06-01','400000','10','4000000'),
-> ('01005','A01','A34','2022-06-02','250000','4','1000000'),
-> ('01006','A01','N122','2022-06-03','400000','2','800000');
Query OK, 6 rows affected (0.132 sec)
Records: 6 Duplicates: 0 Warnings: 0

MariaDB [toko_baju]> select*from penjualan;


+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1001 | A01 | A34 | 2022-05-22 | 250000 | 2 |
500000 |
| 1002 | A01 | M94 | 2022-05-22 | 150000 | 3 |
750000 |
| 1003 | A01 | N110 | 2022-05-24 | 300000 | 4 |
1200000 |
| 1004 | A01 | N122 | 2022-06-01 | 400000 | 10 |
4000000 |
| 1005 | A01 | A34 | 2022-06-02 | 250000 | 4 |
1000000 |
| 1006 | A01 | N122 | 2022-06-03 | 400000 | 2 |
800000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
6 rows in set (0.000 sec)

MariaDB [toko_baju]> create table kasir


-> (no_kasir char(3) not null,
-> nama varchar(35) not null,
-> no_telp varchar(15) not null,
-> alamat varchar(50) not null,
-> primary key(no_kasir));
Query OK, 0 rows affected (0.297 sec)

MariaDB [toko_baju]> insert into kasir


-> (no_kasir,nama,no_telp,alamat)
-> values
-> ('A01','SAFFRUDIN','081567677878','Kota Paris'),
-> ('A02','DODI MULYONO','085829293030','Cisaat'),
-> ('A03','AYU ALMANDA','081289892727','Cemerlang'),
-> ('A04','DARA AISYAH','085690908888'),
-> ('A05','GHAFUR SEPTIAN','081245457777');
ERROR 1136 (21S01): Column count doesn't match value count at row 4
MariaDB [toko_baju]> insert into kasir
-> (no_kasir,nama,no_telp,alamat)
-> values
-> ('A01','SAFFRUDIN','081567677878','Kota Paris'),
-> ('A02','DODI MULYONO','085829293030','Cisaat'),
-> ('A03','AYU ALMANDA','081289892727','Cemerlang'),
-> ('A04','DARA AISYAH','085690908888','Gegerbitung'),
-> ('A05','GHAFUR SEPTIAN','081245457777','Cibatu);
'> '
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near '' at
line 8
MariaDB [toko_baju]> insert into kasir
-> (no_kasir,nama,no_telp,alamat)
-> values
-> ('A01','SAFFRUDIN','081567677878','Kota Paris'),
-> ('A02','DODI MULYONO','085829293030','Cisaat'),
-> ('A03','AYU ALMANDA','081289892727','Cemerlang'),
-> ('A04','DARA AISYAH','085690908888','Gegerbitung'),
-> ('A05','GHAFUR SEPTIAN','081245457777','Cibatu');
Query OK, 5 rows affected (0.105 sec)
Records: 5 Duplicates: 0 Warnings: 0

MariaDB [toko_baju]> select*from kasir;


+----------+----------------+--------------+-------------+
| no_kasir | nama | no_telp | alamat |
+----------+----------------+--------------+-------------+
| A01 | SAFFRUDIN | 081567677878 | Kota Paris |
| A02 | DODI MULYONO | 085829293030 | Cisaat |
| A03 | AYU ALMANDA | 081289892727 | Cemerlang |
| A04 | DARA AISYAH | 085690908888 | Gegerbitung |
| A05 | GHAFUR SEPTIAN | 081245457777 | Cibatu |
+----------+----------------+--------------+-------------+
5 rows in set (0.000 sec)

MariaDB [toko_baju]> create table penjualan


-> (id_penjualan int(5) primary key,
-> no_kasir char(3) not null,
-> kode_produk char(4) not null,
-> tgl_penjualan date not null,
-> harga double not null,
-> jumlah_beli int(4) not null,
-> total_harga double not null);
Query OK, 0 rows affected (0.311 sec)

MariaDB [toko_baju]> insert into penjualan


->
(id_penjualan,no_kasir,kode_produk,tgl_penjualan,harga,jumlah_beli,total_harga)
-> values
-> ('01001','A01','A34','2022-05-22','250000','2','500000'),
-> ('01002','A01','M94','2022-05-22','150000','3','750000'),
-> ('01003','A02','N110','2022-05-24','300000','4','1200000'),
-> ('01004','A03','N122','2022-06-01','400000','10','4000000'),
-> ('01005','A02','A34','2022-06-02','250000','4','1000000'),
-> ('01006','A02','N122','2022-06-03','400000','2','800000');
Query OK, 6 rows affected (0.061 sec)
Records: 6 Duplicates: 0 Warnings: 0

MariaDB [toko_baju]> select*from penjualan;


+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1001 | A01 | A34 | 2022-05-22 | 250000 | 2 |
500000 |
| 1002 | A01 | M94 | 2022-05-22 | 150000 | 3 |
750000 |
| 1003 | A02 | N110 | 2022-05-24 | 300000 | 4 |
1200000 |
| 1004 | A03 | N122 | 2022-06-01 | 400000 | 10 |
4000000 |
| 1005 | A02 | A34 | 2022-06-02 | 250000 | 4 |
1000000 |
| 1006 | A02 | N122 | 2022-06-03 | 400000 | 2 |
800000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
6 rows in set (0.001 sec)

MariaDB [toko_baju]> delete from kasir where no_kasir='A05';


Query OK, 1 row affected (0.041 sec)

MariaDB [toko_baju]> UPDAE 'KASIR' set 'no_kasir' = 'A16' WHERE 'kasir','no_kasir'


= 'A04';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near 'UPDAE
'KASIR' set 'no_kasir' = 'A16' WHERE 'kasir','no_kasir' = 'A04'' at line 1
MariaDB [toko_baju]> UPDAE 'kasir' set 'no_kasir' = 'A16' WHERE 'kasir','no_kasir'
= 'A04';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near 'UPDAE
'kasir' set 'no_kasir' = 'A16' WHERE 'kasir','no_kasir' = 'A04'' at line 1
MariaDB [toko_baju]> UPDATE 'kasir' set 'no_kasir' = 'A16' WHERE 'kasir','no_kasir'
= 'A04';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
''kasir' set 'no_kasir' = 'A16' WHERE 'kasir','no_kasir' = 'A04'' at line 1
MariaDB [toko_baju]> UPDATE 'kasir' set 'no_kasir' = 'A06' WHERE 'kasir','no_kasir'
= 'A04'
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
''kasir' set 'no_kasir' = 'A06' WHERE 'kasir','no_kasir' = 'A04'' at line 1
MariaDB [toko_baju]> UPDATE 'kasir' set 'no_kasir' = 'A06' WHERE 'kasir','no_kasir'
= 'A04';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
''kasir' set 'no_kasir' = 'A06' WHERE 'kasir','no_kasir' = 'A04'' at line 1
MariaDB [toko_baju]> UPDATE 'kasir' SET 'no_kasir' = 'A06' WHERE 'kasir','no_kasir'
= 'A04';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
''kasir' SET 'no_kasir' = 'A06' WHERE 'kasir','no_kasir' = 'A04'' at line 1
MariaDB [toko_baju]> UPDATE 'kasir' SET 'no_kasir' = 'A04' WHERE 'kasir','no_kasir'
= 'A06';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
''kasir' SET 'no_kasir' = 'A04' WHERE 'kasir','no_kasir' = 'A06'' at line 1
MariaDB [toko_baju]> UPDATE 'kasir' SET 'no_kasir' = 'A06' WHERE 'kasir'.'no_kasir'
= 'A04';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
''kasir' SET 'no_kasir' = 'A06' WHERE 'kasir'.'no_kasir' = 'A04'' at line 1
MariaDB [toko_baju]> UPDATE 'kasir' SET 'no_kasir' = 'A06' WHERE 'kasir'.'no_kasir'
= 'A04';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
''kasir' SET 'no_kasir' = 'A06' WHERE 'kasir'.'no_kasir' = 'A04'' at line 1
MariaDB [toko_baju]> UPDATE 'stok' SET 'harga' = '230000' WHERE
'stok'.'kode_produk' = 'A34';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near ''stok'
SET 'harga' = '230000' WHERE 'stok'.'kode_produk' = 'A34'' at line 1
MariaDB [toko_baju]> UPDATE 'stok' SET 'harga' = '250000' WHERE
'stok'.'kode_produk' = 'A34';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near ''stok'
SET 'harga' = '250000' WHERE 'stok'.'kode_produk' = 'A34'' at line 1
MariaDB [toko_baju]> UPDATE 'kasir' SET 'no_kasir' = 'A06' WHERE 'kasir'.'no_kasir'
= 'A04';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
''kasir' SET 'no_kasir' = 'A06' WHERE 'kasir'.'no_kasir' = 'A04'' at line 1
MariaDB [toko_baju]> insert into penjualan
->
(id_penjualan,no_kasir,kode_produk,tgl_penjualan,harga,jumlah_beli,total_harga)
-> values
-> ('01001','A01','A34','2022-05-22','250000','2','500000'),
-> ('01002','A02','N110','2022-05-24','300000','2','600000'),
-> ('01003','A02','N110','2022-05-24','300000','4','1200000'),
-> ('01004','A03','N122','2022-06-01','400000','10','4000000'),
-> ('01005','A02','A34','2022-06-02','250000','4','1000000'),
-> ('01006','A02','N122','2022-06-03','400000','2','800000');
Query OK, 6 rows affected (0.067 sec)
Records: 6 Duplicates: 0 Warnings: 0
MariaDB [toko_baju]> select*from penjualan;
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1001 | A01 | A34 | 2022-05-22 | 250000 | 2 |
500000 |
| 1002 | A02 | N110 | 2022-05-24 | 300000 | 2 |
600000 |
| 1003 | A02 | N110 | 2022-05-24 | 300000 | 4 |
1200000 |
| 1004 | A03 | N122 | 2022-06-01 | 400000 | 10 |
4000000 |
| 1005 | A02 | A34 | 2022-06-02 | 250000 | 4 |
1000000 |
| 1006 | A02 | N122 | 2022-06-03 | 400000 | 2 |
800000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
6 rows in set (0.000 sec)

MariaDB [toko_baju]> select*from stok


-> ;
+-------------+----------------------+------+--------+--------+
| kode_produk | nama_produk | size | jumlah | harga |
+-------------+----------------------+------+--------+--------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 150000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 |
| N122 | NIKE HOODIE | S | 56 | 400000 |
+-------------+----------------------+------+--------+--------+
6 rows in set (0.001 sec)

MariaDB [toko_baju]> UPDATE 'stok' SET 'harga' = '100000' WHERE


'stok'.'kode_produk' = 'M94';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near ''stok'
SET 'harga' = '100000' WHERE 'stok'.'kode_produk' = 'M94'' at line 1
MariaDB [toko_baju]> UPDATE 'stok' SET 'harga'='100000' WHERE
'stok'.'kode_produk'='M94';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near ''stok'
SET 'harga'='100000' WHERE 'stok'.'kode_produk'='M94'' at line 1
MariaDB [toko_baju]> UPDATE 'stok' SET 'harga'='150000' WHERE
'stok'.'kode_produk'='M94';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near ''stok'
SET 'harga'='150000' WHERE 'stok'.'kode_produk'='M94'' at line 1
MariaDB [toko_baju]> UPDATE stok set harga = '150000' WHERE kode_produk='M94';
Query OK, 0 rows affected (0.001 sec)
Rows matched: 1 Changed: 0 Warnings: 0

MariaDB [toko_baju]> UPDATE stok set harga = '100000' WHERE kode_produk='M94';


Query OK, 1 row affected (0.084 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [toko_baju]> UPDATE kasir SET no_kasir = 'A06' WHERE no_kasir = 'A04';
Query OK, 1 row affected (0.067 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [toko_baju]> select*from stok;


+-------------+----------------------+------+--------+--------+
| kode_produk | nama_produk | size | jumlah | harga |
+-------------+----------------------+------+--------+--------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 100000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 |
| N122 | NIKE HOODIE | S | 56 | 400000 |
+-------------+----------------------+------+--------+--------+
6 rows in set (0.001 sec)

MariaDB [toko_baju]> insert into stok values ('C12','CONVERSE SWEATER


12','L','30','240000');
Query OK, 1 row affected (0.064 sec)

MariaDB [toko_baju]> select*from stok;


+-------------+----------------------+------+--------+--------+
| kode_produk | nama_produk | size | jumlah | harga |
+-------------+----------------------+------+--------+--------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 |
| C12 | CONVERSE SWEATER 12 | L | 30 | 240000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 100000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 |
| N122 | NIKE HOODIE | S | 56 | 400000 |
+-------------+----------------------+------+--------+--------+
7 rows in set (0.001 sec)

MariaDB [toko_baju]> select*from kasir;


+----------+--------------+--------------+-------------+
| no_kasir | nama | no_telp | alamat |
+----------+--------------+--------------+-------------+
| A01 | SAFFRUDIN | 081567677878 | Kota Paris |
| A02 | DODI MULYONO | 085829293030 | Cisaat |
| A03 | AYU ALMANDA | 081289892727 | Cemerlang |
| A06 | DARA AISYAH | 085690908888 | Gegerbitung |
+----------+--------------+--------------+-------------+
4 rows in set (0.001 sec)

MariaDB [toko_baju]> select*from stok;


+-------------+----------------------+------+--------+--------+
| kode_produk | nama_produk | size | jumlah | harga |
+-------------+----------------------+------+--------+--------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 |
| C12 | CONVERSE SWEATER 12 | L | 30 | 240000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 100000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 |
| N122 | NIKE HOODIE | S | 56 | 400000 |
+-------------+----------------------+------+--------+--------+
7 rows in set (0.000 sec)

MariaDB [toko_baju]> select*from stok where harga >= '200000';


+-------------+----------------------+------+--------+--------+
| kode_produk | nama_produk | size | jumlah | harga |
+-------------+----------------------+------+--------+--------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 |
| C12 | CONVERSE SWEATER 12 | L | 30 | 240000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 |
| N122 | NIKE HOODIE | S | 56 | 400000 |
+-------------+----------------------+------+--------+--------+
6 rows in set (0.057 sec)

MariaDB [toko_baju]> select max(harga) from stok;


+------------+
| max(harga) |
+------------+
| 400000 |
+------------+
1 row in set (0.000 sec)

MariaDB [toko_baju]> select*from penjualan;


+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1001 | A01 | A34 | 2022-05-22 | 250000 | 2 |
500000 |
| 1002 | A02 | N110 | 2022-05-24 | 300000 | 2 |
600000 |
| 1003 | A02 | N110 | 2022-05-24 | 300000 | 4 |
1200000 |
| 1004 | A03 | N122 | 2022-06-01 | 400000 | 10 |
4000000 |
| 1005 | A02 | A34 | 2022-06-02 | 250000 | 4 |
1000000 |
| 1006 | A02 | N122 | 2022-06-03 | 400000 | 2 |
800000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
6 rows in set (0.000 sec)

MariaDB [toko_baju]> select*, (harga*4) as total fro stok;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near 'fro
stok' at line 1
MariaDB [toko_baju]> select*, (harga*4) as total from stok;
+-------------+----------------------+------+--------+--------+---------+
| kode_produk | nama_produk | size | jumlah | harga | total |
+-------------+----------------------+------+--------+--------+---------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 | 1000000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 | 1000000 |
| C12 | CONVERSE SWEATER 12 | L | 30 | 240000 | 960000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 100000 | 400000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 | 1200000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 | 1396000 |
| N122 | NIKE HOODIE | S | 56 | 400000 | 1600000 |
+-------------+----------------------+------+--------+--------+---------+
7 rows in set (0.001 sec)

MariaDB [toko_baju]> select*, (harga*50) as total from stok;


+-------------+----------------------+------+--------+--------+----------+
| kode_produk | nama_produk | size | jumlah | harga | total |
+-------------+----------------------+------+--------+--------+----------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 | 12500000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 | 12500000 |
| C12 | CONVERSE SWEATER 12 | L | 30 | 240000 | 12000000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 100000 | 5000000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 | 15000000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 | 17450000 |
| N122 | NIKE HOODIE | S | 56 | 400000 | 20000000 |
+-------------+----------------------+------+--------+--------+----------+
7 rows in set (0.000 sec)

MariaDB [toko_baju]> select * , (harga*50) as total from stok;


+-------------+----------------------+------+--------+--------+----------+
| kode_produk | nama_produk | size | jumlah | harga | total |
+-------------+----------------------+------+--------+--------+----------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 | 12500000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 | 12500000 |
| C12 | CONVERSE SWEATER 12 | L | 30 | 240000 | 12000000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 100000 | 5000000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 | 15000000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 | 17450000 |
| N122 | NIKE HOODIE | S | 56 | 400000 | 20000000 |
+-------------+----------------------+------+--------+--------+----------+
7 rows in set (0.000 sec)

MariaDB [toko_baju]> select*from penjualan;


+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1001 | A01 | A34 | 2022-05-22 | 250000 | 2 |
500000 |
| 1002 | A02 | N110 | 2022-05-24 | 300000 | 2 |
600000 |
| 1003 | A02 | N110 | 2022-05-24 | 300000 | 4 |
1200000 |
| 1004 | A03 | N122 | 2022-06-01 | 400000 | 10 |
4000000 |
| 1005 | A02 | A34 | 2022-06-02 | 250000 | 4 |
1000000 |
| 1006 | A02 | N122 | 2022-06-03 | 400000 | 2 |
800000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
6 rows in set (0.000 sec)

MariaDB [toko_baju]> select max(harga) from stok;


+------------+
| max(harga) |
+------------+
| 400000 |
+------------+
1 row in set (0.000 sec)

MariaDB [toko_baju]> select * , (harga*50) as total from stok;


+-------------+----------------------+------+--------+--------+----------+
| kode_produk | nama_produk | size | jumlah | harga | total |
+-------------+----------------------+------+--------+--------+----------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 | 12500000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 | 12500000 |
| C12 | CONVERSE SWEATER 12 | L | 30 | 240000 | 12000000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 100000 | 5000000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 | 15000000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 | 17450000 |
| N122 | NIKE HOODIE | S | 56 | 400000 | 20000000 |
+-------------+----------------------+------+--------+--------+----------+
7 rows in set (0.000 sec)

MariaDB [toko_baju]> select*from stok;


+-------------+----------------------+------+--------+--------+
| kode_produk | nama_produk | size | jumlah | harga |
+-------------+----------------------+------+--------+--------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 |
| C12 | CONVERSE SWEATER 12 | L | 30 | 240000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 100000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 |
| N122 | NIKE HOODIE | S | 56 | 400000 |
+-------------+----------------------+------+--------+--------+
7 rows in set (0.000 sec)

MariaDB [toko_baju]> select * , (harga*20) as total from stok;


+-------------+----------------------+------+--------+--------+---------+
| kode_produk | nama_produk | size | jumlah | harga | total |
+-------------+----------------------+------+--------+--------+---------+
| A32 | ADIDAS TSHIRT FULL W | L | 44 | 250000 | 5000000 |
| A34 | ADIDAS TSHIRT FULL R | L | 34 | 250000 | 5000000 |
| C12 | CONVERSE SWEATER 12 | L | 30 | 240000 | 4800000 |
| M94 | MANCHASTER UNITED JE | XXL | 20 | 100000 | 2000000 |
| N110 | NIKE SPORTWEAR MAX 9 | M | 50 | 300000 | 6000000 |
| N111 | NIKE SPORTWEAR PREMI | L | 40 | 349000 | 6980000 |
| N122 | NIKE HOODIE | S | 56 | 400000 | 8000000 |
+-------------+----------------------+------+--------+--------+---------+
7 rows in set (0.000 sec)

MariaDB [toko_baju]> select * from penjualan order by total_harga DESC;


+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| id_penjualan | no_kasir | kode_produk | tgl_penjualan | harga | jumlah_beli |
total_harga |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
| 1004 | A03 | N122 | 2022-06-01 | 400000 | 10 |
4000000 |
| 1003 | A02 | N110 | 2022-05-24 | 300000 | 4 |
1200000 |
| 1005 | A02 | A34 | 2022-06-02 | 250000 | 4 |
1000000 |
| 1006 | A02 | N122 | 2022-06-03 | 400000 | 2 |
800000 |
| 1002 | A02 | N110 | 2022-05-24 | 300000 | 2 |
600000 |
| 1001 | A01 | A34 | 2022-05-22 | 250000 | 2 |
500000 |
+--------------+----------+-------------+---------------+--------+-------------
+-------------+
6 rows in set (0.001 sec)

MariaDB [toko_baju]> select * from kasir inner join penjualan on


kasir.no_kasir=penjualan.no_kasir;
+----------+--------------+--------------+------------+--------------+----------
+-------------+---------------+--------+-------------+-------------+
| no_kasir | nama | no_telp | alamat | id_penjualan | no_kasir |
kode_produk | tgl_penjualan | harga | jumlah_beli | total_harga |
+----------+--------------+--------------+------------+--------------+----------
+-------------+---------------+--------+-------------+-------------+
| A01 | SAFFRUDIN | 081567677878 | Kota Paris | 1001 | A01 |
A34 | 2022-05-22 | 250000 | 2 | 500000 |
| A02 | DODI MULYONO | 085829293030 | Cisaat | 1002 | A02 |
N110 | 2022-05-24 | 300000 | 2 | 600000 |
| A02 | DODI MULYONO | 085829293030 | Cisaat | 1003 | A02 |
N110 | 2022-05-24 | 300000 | 4 | 1200000 |
| A03 | AYU ALMANDA | 081289892727 | Cemerlang | 1004 | A03 |
N122 | 2022-06-01 | 400000 | 10 | 4000000 |
| A02 | DODI MULYONO | 085829293030 | Cisaat | 1005 | A02 |
A34 | 2022-06-02 | 250000 | 4 | 1000000 |
| A02 | DODI MULYONO | 085829293030 | Cisaat | 1006 | A02 |
N122 | 2022-06-03 | 400000 | 2 | 800000 |
+----------+--------------+--------------+------------+--------------+----------
+-------------+---------------+--------+-------------+-------------+
6 rows in set (0.063 sec)

MariaDB [toko_baju]> desc stok;


+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| kode_produk | char(4) | NO | PRI | NULL | |
| nama_produk | varchar(20) | YES | | NULL | |
| size | varchar(5) | YES | | NULL | |
| jumlah | int(4) | YES | | NULL | |
| harga | double | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
5 rows in set (0.017 sec)

MariaDB [toko_baju]> desc kasir;


+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| no_kasir | char(3) | NO | PRI | NULL | |
| nama | varchar(35) | NO | | NULL | |
| no_telp | varchar(15) | NO | | NULL | |
| alamat | varchar(50) | NO | | NULL | |
+----------+-------------+------+-----+---------+-------+
4 rows in set (0.020 sec)
MariaDB [toko_baju]> desc penjualan;
+---------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+---------+------+-----+---------+-------+
| id_penjualan | int(5) | NO | PRI | NULL | |
| no_kasir | char(3) | NO | | NULL | |
| kode_produk | char(4) | NO | | NULL | |
| tgl_penjualan | date | NO | | NULL | |
| harga | double | NO | | NULL | |
| jumlah_beli | int(4) | NO | | NULL | |
| total_harga | double | NO | | NULL | |
+---------------+---------+------+-----+---------+-------+
7 rows in set (0.079 sec)

MariaDB [toko_baju]>

You might also like