KEMBAR78
Tugas Dbms 1 | PDF | Databases | My Sql
0% found this document useful (0 votes)
12 views4 pages

Tugas Dbms 1

Tugas Data Base

Uploaded by

hidayatmarjikan
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)
12 views4 pages

Tugas Dbms 1

Tugas Data Base

Uploaded by

hidayatmarjikan
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/ 4

trMicrosoft Windows [Version 10.0.22631.

3447]

(c) Microsoft Corporation. All rights reserved.

C:\Users\fauzihidayat>c:/xampp/mysql/bin/mysql.exe -u root -p

Enter password:

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

Your MariaDB connection id is 8

Server version: 10.4.32-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)]> create database Mahasiswa;

Query OK, 1 row affected (0.003 sec)

MariaDB [(none)]> use Mahasiswa;

Database changed

MariaDB [Mahasiswa]> create table Mahasiswa (

-> id_mahasiswa INT AUTO_INCREMENT PRIMARY KEY,

-> nim VARCHAR(20) NOT NULL UNIQUE,

-> nama VARCHAR(100) NOT NULL,

-> jurusan VARCHAR(100) NOT NULL,

-> angkatan YEAR NOT NULL );

Query OK, 0 rows affected (0.056 sec)

MariaDB [Mahasiswa]> show tables);

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 1

MariaDB [Mahasiswa]> show tables;

+---------------------+
| Tables_in_mahasiswa |

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

| mahasiswa |

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

1 row in set (0.001 sec)

MariaDB [Mahasiswa]> desc Mahasiswa;

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

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

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

| id_mahasiswa | int(11) | NO | PRI | NULL | auto_increment |

| nim | varchar(20) | NO | UNI | NULL | |

| nama | varchar(100) | NO | | NULL | |

| jurusan | varchar(100) | NO | | NULL | |

| angkatan | year(4) | NO | | NULL | |

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

5 rows in set (0.038 sec)

MariaDB [Mahasiswa]>

MariaDB [Mahasiswa]>

MariaDB [Mahasiswa]> ByeCtrl-C -- exit!

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.32-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)]> create database MataKuliah;

Query OK, 1 row affected (0.003 sec)

MariaDB [(none)]> use MataKuliah;

Database changed

MariaDB [MataKuliah]> CREATE TABLE MataKuliah (

-> id_MataKuliah INT AUTO_INCREMENT PRIMARY KEY,

-> kode_MataKuliah VARCHAR(20) NOT NULL UNIQUE,

-> nama_MataKuliah VARCHAR(100) NOT NULL,

-> sks INT NOT NULL );

Query OK, 0 rows affected (0.074 sec)

MariaDB [MataKuliah]> show tables;

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

| Tables_in_matakuliah |

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

| matakuliah |

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

1 row in set (0.001 sec)

MariaDB [MataKuliah]> desc MataKuliah;

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

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

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

| id_MataKuliah | int(11) | NO | PRI | NULL | auto_increment |

| kode_MataKuliah | varchar(20) | NO | UNI | NULL | |

| nama_MataKuliah | varchar(100) | NO | | NULL | |

| sks | int(11) | NO | | NULL | |

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

4 rows in set (0.057 sec)


MariaDB [MatMicrosoft Windows [Version 10.0.22631.3447]

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

(c) Microsoft Corporation. All rights reserved.aKuliah]> byeCtrl-C -- exit!

You might also like