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.
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 ratings0% 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.
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)
+----------+------------------+-------------+-------+ | nis | nama | alamat | kelas | +----------+------------------+-------------+-------+ | 11223344 | Aflah Fadhlillah | Pondok Gede | IX | +----------+------------------+-------------+-------+ 1 row in set (0.008 sec)
+----------+----------------------+--------------------+-------+ | 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)