# CD C:/xampp/mysql/bin
# CD C:/xampp/mysql/bin
# CD C:/xampp/mysql/bin
USER@DESKTOP-J009T6N c:\xampp
# cd c:/xampp/mysql/bin
USER@DESKTOP-J009T6N c:\xampp\mysql\bin
# mysql -u root
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
+--------------------+
| Database |
+--------------------+
| data_karyawan |
| information_schema |
| karyawan |
| mysql |
| performance_schema |
| phpmyadmin |
| test |
+--------------------+
7 rows in set (0.09 sec)
->namavarchar(255),
->alamatvarchar(200),
->pendidikanchar(50));
Database changed
->nama varchar(255),
->alamat varchar(200),
->pendidikan char(50));
->nama varchar(50),
->keterangan char);
->kdkriteria int,
->nilai int,
+------------+--------------+------+-----+---------+-------+
+------------+--------------+------+-----+---------+-------+
+------------+--------------+------+-----+---------+-------+
+------------+-------------+------+-----+---------+-------+
+------------+-------------+------+-----+---------+-------+
+------------+-------------+------+-----+---------+-------+
-> ));
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
+------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------+------+-----+---------+-------+
+------------+---------+------+-----+---------+-------+
-> (1,'kedisiplinan','NULL'),
-> (2,'kejujuran','NULL'),
-> (3,'kesetiakawanan','NULL'),
-> ));
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 '1,'kedisiplinan','NULL'),
(2,'kejujuran','NULL'),
(3,'kesetiakawanan','NULL'),
)' at line 2
-> (1,'kedisiplinan','NULL'),
-> (2,'kejujuran','NULL'),
-> (3,'kesetiakawanan','NULL'));
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 '1,'kedisiplinan','NULL'),
(2,'kejujuran','NULL'),
(3,'kesetiakawanan','NULL'))' at line 2
-> (1,'kedisiplinan','NULL'),
-> (2,'kejujuran','NULL'),
-> (3,'kesetiakawanan','NULL');
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 '1,'kedisiplinan','NULL'),
(2,'kejujuran','NULL'),
(3,'kesetiakawanan','NULL')' at line 2
-> (1,'kedisiplinan','NULL'),
-> (2,'kejujuran','NULL'),
-> (3,'kesetiakawanan','NULL'));
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 '(1,'kedisiplinan','NULL'),
(2,'kejujuran','NULL'),
(3,'kesetiakawanan','NULL'))' at line 2
-> ('1','kedisiplinan','NULL'),
-> ('2','kejujuran','NULL'),
-> ('3','kejujuran','NULL'));
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 '('1','kedisiplinan','NULL'),
('2','kejujuran','NULL'),
('3','kejujuran','NULL'))' at line 2
-> (1,'kedisiplinan','NULL'),
-> (1,'kejujuran','NULL'),
-> (3,'kesetiakawanan','NULL'),
-> :
-> ;
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 5
-> (1,'kedisiplinan','NULL'),
-> (2,'kejujuran','NULL'),
-> (3,'kesetiakawan','NULL'),
-> ;
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 4
-> (1,'kedisiplinan','NULL'),
-> (2,'kejujuran','NULL'),
-> (3,'kesetiakawan','NULL');
-> (1,'2','3'),
-> (1,'3','4'),
-> (2,'1','3'),
-> (2,'2','3'),
-> (2,'3','4'),
-> (3,'1','1'),
-> (3,'2','4'),
-> (3,'3','4');
+-----+------+--------+------------+
+-----+------+--------+------------+
| 1 | agus | yogya | S1 |
| 2 | andi | yogya | S1 |
| 3 | mia |klaten | S2 |
| 4 | lala | bantul | D3 |
+-----+------+--------+------------+
+-----+------+--------+------------+
+-----+------+--------+------------+
| 4 | lala | bantul | D3 |
| 3 | mia |klaten | S2 |
| 2 | andi | yogya | S1 |
| 1 | agus | yogya | S1 |
+-----+------+--------+------------+
+-----+------+--------+------------+
+-----+------+--------+------------+
| 1 | agus | yogya | S1 |
| 2 | andi | yogya | S1 |
| 3 | mia |klaten | S2 |
| 4 | lala | bantul | D3 |
+-----+------+--------+------------+
+-----+------+--------+------------+
+-----+------+--------+------------+
| 1 | agus | yogya | S1 |
| 2 | andi | yogya | S1 |
| 4 | lala | bantul | D3 |
| 3 | mia |klaten | S2 |
+-----+------+--------+------------+
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 '"1"' at line 1
MariaDB [karyawan]> select*from karyawan where mid(nama,2,1)-"1";
+-----+------+--------+------------+
+-----+------+--------+------------+
| 1 | agus | yogya | S1 |
| 2 | andi | yogya | S1 |
| 3 | mia |klaten | S2 |
| 4 | lala | bantul | D3 |
+-----+------+--------+------------+
+----------+
| count(*) |
+----------+
| 4|
+----------+
+-----+------+--------+------------+
+-----+------+--------+------------+
| 1 | agus | yogya | S1 |
| 2 | andi | yogya | S1 |
+-----+------+--------+------------+
+-----+------+--------+------------+
+-----+------+--------+------------+
| 3 | mia |klaten | S2 |
+-----+------+--------+------------+
+-----+------+--------+------------+
+-----+------+--------+------------+
| 4 | lala | bantul | D3 |
+-----+------+--------+------------+
+-----------------+
| max(kdkriteria) |
+-----------------+
| 3|
+-----------------+
+------+------------+----------+
+------+------------+----------+
| 1| 2 | 3.5000 |
| 2| 1 | 3.3333 |
| 3| 1 | 3.0000 |
+------+------------+----------+
+-----+------+------------+-------+
+-----+------+------------+-------+
| 1 | agus | 3| 4|
| 1 | agus | 2| 3|
| 2 | andi | 3| 4|
| 2 | andi | 2| 3|
| 2 | andi | 1| 3|
| 3 | mia | 3| 4|
| 3 | mia | 2| 4|
| 3 | mia | 1| 1|
+-----+------+------------+-------+
+-----+------+------------+-------+
+-----+------+------------+-------+
| 1 | agus | 2| 3|
| 1 | agus | 3| 4|
| 2 | andi | 1| 3|
| 2 | andi | 2| 3|
| 2 | andi | 3| 4|
| 3 | mia | 1| 1|
| 3 | mia | 2| 4|
| 3 | mia | 3| 4|
+-----+------+------------+-------+
MariaDB [karyawan]> select max(nilai) from nilai join karyawan on nilai.NIP=karyawan.NIP where
nama="Nita";
+------------+
| max(nilai) |
+------------+
| 4|
+------------+