0% found this document useful (0 votes)
10 views8 pages

Open Xampp Dengan CMD SBD2

Uploaded by

Hariyanto Alfian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views8 pages

Open Xampp Dengan CMD SBD2

Uploaded by

Hariyanto Alfian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Microsoft Windows [Version 10.0.22621.

2506]

(c) Microsoft Corporation. All rights reserved.

C:\Users\ASUS>D:,

D:\>cd xampp/mysql/bin

D:\xampp\mysql\bin>mysql -u root

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

Your MariaDB connection id is 8

Server version: 10.4.28-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)]> show database;

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 'database' at line 1

MariaDB [(none)]> show databases;

+--------------------+

| Database |

+--------------------+

| crud |

| information_schema |

| mysql |

| performance_schema |

| phpmyadmin |

| test |
| ujian |

+--------------------+

7 rows in set (0.052 sec)

MariaDB [(none)]> create database ITKA;

Query OK, 1 row affected (0.002 sec)

MariaDB [(none)]> show databases;

+--------------------+

| Database |

+--------------------+

| crud |

| information_schema |

| itka |

| mysql |

| performance_schema |

| phpmyadmin |

| test |

| ujian |

+--------------------+

8 rows in set (0.003 sec)

MariaDB [(none)]> create database aku_ganteng;

Query OK, 1 row affected (0.003 sec)

MariaDB [(none)]> show databases;

+--------------------+

| Database |

+--------------------+
| aku_ganteng |

| crud |

| information_schema |

| itka |

| mysql |

| performance_schema |

| phpmyadmin |

| test |

| ujian |

+--------------------+

9 rows in set (0.003 sec)

MariaDB [(none)]> use itka;

Database changed

MariaDB [itka]> create table mahasiswa(

-> Nama varchar (30),

-> NIM int (15) primary key,

-> JK Char (2),

-> Alamat varchar (100));

Query OK, 0 rows affected (0.020 sec)

MariaDB [itka]> show tables;

+----------------+

| Tables_in_itka |

+----------------+

| mahasiswa |

+----------------+

1 row in set (0.001 sec)


MariaDB [itka]> desc mahasiswa;

+--------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------+--------------+------+-----+---------+-------+

| Nama | varchar(30) | YES | | NULL | |

| NIM | int(15) | NO | PRI | NULL | |

| JK | char(2) | YES | | NULL | |

| Alamat | varchar(100) | YES | | NULL | |

+--------+--------------+------+-----+---------+-------+

4 rows in set (0.025 sec)

MariaDB [itka]>

MariaDB [itka]> desc mahasiswa;

+--------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------+--------------+------+-----+---------+-------+

| Nama | varchar(30) | YES | | NULL | |

| NIM | int(15) | NO | PRI | NULL | |

| JK | char(2) | YES | | NULL | |

| Alamat | varchar(100) | YES | | NULL | |

+--------+--------------+------+-----+---------+-------+

4 rows in set (0.037 sec)

MariaDB [itka]> alter table mahasiswa add Status varchar (15) after Alamat;

Query OK, 0 rows affected (0.019 sec)

Records: 0 Duplicates: 0 Warnings: 0

MariaDB [itka]> desc mahasiswa;


+--------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------+--------------+------+-----+---------+-------+

| Nama | varchar(30) | YES | | NULL | |

| NIM | int(15) | NO | PRI | NULL | |

| JK | char(2) | YES | | NULL | |

| Alamat | varchar(100) | YES | | NULL | |

| Status | varchar(15) | YES | | NULL | |

+--------+--------------+------+-----+---------+-------+

5 rows in set (0.025 sec)

MariaDB [itka]>

MariaDB [itka]> alter table mahasiswa modify column Alamat char (50);

Query OK, 0 rows affected (0.064 sec)

Records: 0 Duplicates: 0 Warnings: 0

MariaDB [itka]> desc mahasiswa;

+--------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------+-------------+------+-----+---------+-------+

| Nama | varchar(30) | YES | | NULL | |

| NIM | int(15) | NO | PRI | NULL | |

| JK | char(2) | YES | | NULL | |

| Alamat | char(50) | YES | | NULL | |

| Status | varchar(15) | YES | | NULL | |

+--------+-------------+------+-----+---------+-------+

5 rows in set (0.025 sec)


MariaDB [itka]>

MariaDB [itka]> insert into mahasiswa values

-> ("Doldi", 202259, "LK", "Selong rumah razia", "menikah"),

-> ("Minah", 202260, "PR", "Pancor rumah umkm", "menjanda 2 tahun");

Query OK, 2 rows affected, 1 warning (0.063 sec)

Records: 2 Duplicates: 0 Warnings: 1

MariaDB [itka]> select * from mahasiswa;

+-------+--------+------+--------------------+-----------------+

| Nama | NIM | JK | Alamat | Status |

+-------+--------+------+--------------------+-----------------+

| Doldi | 202259 | LK | Selong rumah razia | menikah |

| Minah | 202260 | PR | Pancor rumah umkm | menjanda 2 tahu |

+-------+--------+------+--------------------+-----------------+

2 rows in set (0.001 sec)

MariaDB [itka]>

MariaDB [itka]> desc mahasiswa;

+--------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------+-------------+------+-----+---------+-------+

| Nama | varchar(30) | YES | | NULL | |

| NIM | int(15) | NO | PRI | NULL | |

| JK | char(2) | YES | | NULL | |

| Alamat | char(50) | YES | | NULL | |

| Status | varchar(15) | YES | | NULL | |

+--------+-------------+------+-----+---------+-------+

5 rows in set (0.028 sec)


MariaDB [itka]> select * from mahasiswa;

+-------+--------+------+--------------------+-----------------+

| Nama | NIM | JK | Alamat | Status |

+-------+--------+------+--------------------+-----------------+

| Ara | 0 | PR | Tanjung Pinang | jomblo |

| Doldi | 202259 | LK | Selong rumah razia | menikah |

| Minah | 202260 | PR | Pancor rumah umkm | menjanda 2 tahu |

+-------+--------+------+--------------------+-----------------+

3 rows in set (0.001 sec)

MariaDB [itka]>

MariaDB [itka]> update mahasiswa set Nama="fara"

-> where NIM=0;

Query OK, 1 row affected (0.009 sec)

Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [itka]> select * from mahasiswa;

+-------+--------+------+--------------------+-----------------+

| Nama | NIM | JK | Alamat | Status |

+-------+--------+------+--------------------+-----------------+

| fara | 0 | PR | Tanjung Pinang | jomblo |

| Doldi | 202259 | LK | Selong rumah razia | menikah |

| Minah | 202260 | PR | Pancor rumah umkm | menjanda 2 tahu |

+-------+--------+------+--------------------+-----------------+

3 rows in set (0.001 sec)

MariaDB [itka]>
MariaDB [itka]> delete from mahasiswa

-> where nim=202259;

Query OK, 1 row affected (0.008 sec)

MariaDB [itka]> select * from mahasiswa;

+-------+--------+------+-------------------+-----------------+

| Nama | NIM | JK | Alamat | Status |

+-------+--------+------+-------------------+-----------------+

| fara | 0 | PR | Tanjung Pinang | jomblo |

| Minah | 202260 | PR | Pancor rumah umkm | menjanda 2 tahu |

+-------+--------+------+-------------------+-----------------+

2 rows in set (0.001 sec)

MariaDB [itka]>

You might also like