Monday, August 26, 2019

Contoh Membuat tabel di CMD(command promt) #2.


Tugas KD 4.6

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\smkn1bangsri>cd..

C:\Users>cd..

C:\>cd xampp

C:\xampp>cd mysql

C:\xampp\mysql>cd bin

C:\xampp\mysql\bin>mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 10.1.30-MariaDB mariadb.org binary distribution

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

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

MariaDB [(none)]> create database pendaftaran;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> use pendaftaran;
Database changed
MariaDB [pendaftaran]> create table pendaftaran (
    -> no int(3),
    -> nama varchar(35),
    -> alamat varchar(60),
    -> email varchar(40),
    -> no_telepon varchar(15),
    -> sex char(1));
Query OK, 0 rows affected (0.14 sec)

MariaDB [pendaftaran]> insert into pendaftaran (no,nama,alamat,email,no_telepon)values(22,'muhammad khusni mubaroh','kepuk rt 2 rw 5','muhammadkhusni112@gmail.com','083456789098');
Query OK, 1 row affected (0.02 sec)

MariaDB [pendaftaran]> select * from pendaftaran;
+------+-------------------------+-----------------+-----------------------------+--------------+------+
| no   | nama                    | alamat          | email                       | no_telepon   | sex  |
+------+-------------------------+-----------------+-----------------------------+--------------+------+
|   22 | muhammad khusni mubaroh | kepuk rt 2 rw 5 | muhammadkhusni112@gmail.com | 083456789098 | NULL |
+------+-------------------------+-----------------+-----------------------------+--------------+------+
1 row in set (0.00 sec)

MariaDB [pendaftaran]> insert into pendaftaran (no,nama,alamat,email,no_telepon)values(04,'ahmad faizul umri','karanggondang rt 5 rw 7','fizulumrri38@gmail.com','087897456324');
Query OK, 1 row affected (0.08 sec)

MariaDB [pendaftaran]> select * from pendaftaran;
+------+-------------------------+-------------------------+-----------------------------+--------------+------+
| no   | nama                    | alamat                  | email                       | no_telepon   | sex  |
+------+-------------------------+-------------------------+-----------------------------+--------------+------+
|   22 | muhammad khusni mubaroh | kepuk rt 2 rw 5         | muhammadkhusni112@gmail.com | 083456789098 | NULL |
|    4 | ahmad faizul umri       | karanggondang rt 5 rw 7 | fizulumrri38@gmail.com      | 087897456324 | NULL |
+------+-------------------------+-------------------------+-----------------------------+--------------+------+
2 rows in set (0.00 sec)

MariaDB [pendaftaran]> insert into pendaftaran (no,nama,alamat,email,no_telepon)values(18,'maulana nofa karisma','jambu timur rt 1 rw 7','maulananofawikwik@gmail.com','081234567098');
Query OK, 1 row affected (0.02 sec)

MariaDB [pendaftaran]> select * from pendaftaran;
+------+-------------------------+-------------------------+-----------------------------+--------------+------+
| no   | nama                    | alamat                  | email                       | no_telepon   | sex  |
+------+-------------------------+-------------------------+-----------------------------+--------------+------+
|   22 | muhammad khusni mubaroh | kepuk rt 2 rw 5         | muhammadkhusni112@gmail.com | 083456789098 | NULL |
|    4 | ahmad faizul umri       | karanggondang rt 5 rw 7 | fizulumrri38@gmail.com      | 087897456324 | NULL |
|   18 | maulana nofa karisma    | jambu timur rt 1 rw 7   | maulananofawikwik@gmail.com | 081234567098 | NULL |
+------+-------------------------+-------------------------+-----------------------------+--------------+------+
3 rows in set (0.00 sec)
MariaDB [pendaftaran]>
Hasilnya!!!!



0 comments:

Post a Comment