0% found this document useful (0 votes)
6 views2 pages

Fisrt

The document details the process of creating and managing a database named 'pesantren' using MariaDB. It includes commands for creating a table 'santri', inserting records, and querying the data, demonstrating successful execution and retrieval of student information. Additionally, it highlights an error in SQL syntax during table creation, which was later corrected.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Fisrt

The document details the process of creating and managing a database named 'pesantren' using MariaDB. It includes commands for creating a table 'santri', inserting records, and querying the data, demonstrating successful execution and retrieval of student information. Additionally, it highlights an error in SQL syntax during table creation, which was later corrected.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

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

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


Your MariaDB connection id is 9
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)]> show databases;


+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| phpmyadmin |
| test |
+--------------------+
5 rows in set (0.030 sec)

MariaDB [(none)]> create database pesantren;


Query OK, 1 row affected (0.009 sec)

MariaDB [(none)]> use pesantren;


Database changed
MariaDB [pesantren]> create table santri(
-> nis int(10) NOT NULL,
-> nama varchar(20),
-> alamat text(100),
-> kelas char (5),
-> );
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 6
MariaDB [pesantren]> create table santri(
-> nis int(10),
-> nama varchar(20),
-> alamat text(100),
-> kelas char (5)
-> );
Query OK, 0 rows affected (0.044 sec)

MariaDB [pesantren]> show tables;


+---------------------+
| Tables_in_pesantren |
+---------------------+
| santri |
+---------------------+
1 row in set (0.007 sec)

MariaDB [pesantren]> select *from santri;


Empty set (0.276 sec)

MariaDB [pesantren]> insert into santri values


('11223344','Aflah Fadhlillah','Pondok Gede','IX');
Query OK, 1 row affected (0.012 sec)

MariaDB [pesantren]> select *from santri;


+----------+------------------+-------------+-------+
| nis | nama | alamat | kelas |
+----------+------------------+-------------+-------+
| 11223344 | Aflah Fadhlillah | Pondok Gede | IX |
+----------+------------------+-------------+-------+
1 row in set (0.008 sec)

MariaDB [pesantren]> insert into santri values


-> ('11223341','Alvito Syarman Siregar','Bantar Gebang','X'),
-> ('11223340','Muhammad Ardan Sundawa','Pondok Gede','X'),
-> ('11223339','Mahmued Abdur Rozaq','Pondok Gede Poesat','X');
Query OK, 3 rows affected, 2 warnings (0.012 sec)
Records: 3 Duplicates: 0 Warnings: 2

MariaDB [pesantren]> select *from santri;


+----------+----------------------+--------------------+-------+
| nis | nama | alamat | kelas |
+----------+----------------------+--------------------+-------+
| 11223344 | Aflah Fadhlillah | Pondok Gede | IX |
| 11223341 | Alvito Syarman Sireg | Bantar Gebang | X |
| 11223340 | Muhammad Ardan Sunda | Pondok Gede | X |
| 11223339 | Mahmued Abdur Rozaq | Pondok Gede Poesat | X |
+----------+----------------------+--------------------+-------+
4 rows in set (0.000 sec)

MariaDB [pesantren]> Ctrl-C -- exit!


Bye

C:\xampp\mysql\bin>
-----------------------------------------------------------------------------------
---------------

('11223344','Muhammad Hammam Riziq','Tanah Abang','X'),


('11222222','Ibnu Hanif Maulana','Amerika','X'),
('11223000','Muhammad Alfiansyah','Pondok Gede','X'),
('11243340','Muhammad Fatihah Zahid','Padang','X'),
('11993340','Muhammad Ziyad Hasan','Planet Bekasi','X'),
('10993340','Muhammad Syamil Hamasah','Bangka ','VIII'),
('11111111','Mahesa Vatian','Jakarta Utara','VIII'),
('18232032','Farhan Fauzi Amir','Yaman','VIII'),
('18232121','Ziyad Ahmad Musyafa','Kuningan','IX'),
('12938328','Mushab Arrantisi','Padang ','IX'),
('15632341','Rahmatullah Yusuf Ihsan','Jakarta Pusat','X'),
('18231393','Muhammad Nashir Amrullah','Jatiwaringin','X'),
('18212313','Ashraf El-Hafiedza Rusmana','Depok','X'),
('12342282','Hudzaifah Ali Miftah','Jakarta Utara','X'),
('23321313','Rasyid Anwar Arief','Depok','X'),
('11212311','Muhammad Muzaffar Abdussalam','Ciganjur','X'),
('11221233','Muhammad Ridho','Pondok Gede','X'),
('11255323','Hilmiy Mufid','Pondok Gede','X');

You might also like