The document shows SQL commands used to create databases, tables, and insert data in MariaDB. It creates a Universitas database and tables for students (mahasiswa), courses (matakuliah), and student grades (nilaiakhir). It then inserts sample data into the mahasiswa table.
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)
20 views2 pages
Corat Core T
The document shows SQL commands used to create databases, tables, and insert data in MariaDB. It creates a Universitas database and tables for students (mahasiswa), courses (matakuliah), and student grades (nilaiakhir). It then inserts sample data into the mahasiswa table.
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 'mahasiswa' at line 1 MariaDB [Universitas]> select*from mahasiswa; Empty set (0.00 sec)
matakuliah(kode_matakuliah(cha--------------------+ -> | Database | -> +--------------------+ -> | information_schema | -> | inventory | -> | mysql | -> | performance_schema | -> | phpmyadmin | -> | rs_uas | -> | universitas | -> desc mahasiswa;; 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 '(cha--------------------+ | Database | +--------------------+ | inform' at line 1 ERROR: No query specified
MariaDB [Universitas]> create table matakuliah(kode_matakuliah char(5) not
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 'decs matakuliah' at line 1 MariaDB [Universitas]> desc matakuliah; +-----------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+-------------+------+-----+---------+-------+ | kode_matakuliah | char(5) | NO | | NULL | | | nama_matakuliah | varchar(10) | YES | | NULL | | | jumlah_sks | char(30) | YES | | NULL | | +-----------------+-------------+------+-----+---------+-------+ 3 rows in set (0.02 sec)
null,kode_matakuliah(5),nilai_uts int(3) nilai_uas int(3) grade_nilai char(1)); 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 '(5),nilai_uts int(3) nilai_uas int(3) grade_nilai char(1))' at line 1 MariaDB [Universitas]> create table nilaiakhir(nim char(13)not null,kode_matakuliah char(5),nilai_uts int(3), nilai_uas int(3), grade_nilai char(1)); Query OK, 0 rows affected (0.23 sec)