Sunteți pe pagina 1din 3

Nama : Yusuf Agin W /11.0502.0018 Adi Harsono /11.0502.

0021

mysql> CREATE DATABASE PERUSAHAAN; Query OK, 1 row affected (0.02 sec) mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | buku | | mysql | | perusahaan | | test | +--------------------+ 5 rows in set (0.02 sec) mysql> USE peserta ; ERROR 1049 (42000): Unknown database 'peserta' mysql> USE peserta ERROR 1049 (42000): Unknown database 'peserta' mysql> USE peserta ERROR 1049 (42000): Unknown database 'peserta' mysql> mysql> * Menciptakan tabel -> -> CREATE TABLE tblpeserta -> ( -> nopeserta INTEGER, -> nama varCHAR(20), -> kode_instansi CHAR(5) references instansi, -> prestasi INTEGER -> ); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* Men ciptakan tabel CREATE TABLE tblpeserta ( nopeserta INTEG' at line 1 mysql> CREATE DATABASE PERUSAHAAN; ERROR 1007 (HY000): Can't create database 'perusahaan'; database exists mysql> use perusahaan; Database changed mysql> CREATE TABLE tblpeserta -> ( -> nopeserta INTEGER, -> nama varCHAR(20), -> kode_instansi CHAR(5) references instansi, -> prestasi INTEGER ); Query OK, 0 rows affected (0.17 sec) mysql> INSERT INTO tblpeserta VALUES (1, 'Dora', 'PLN',98); Query OK, 1 row affected (0.09 sec) mysql> INSERT INTO tblpeserta VALUES (2, 'Momon', 'PLN',80); Query OK, 1 row affected (0.03 sec)

mysql> INSERT INTO tblpeserta VALUES (3, 'Arbi', 'BRI',90); Query OK, 1 row affected (0.03 sec) mysql> INSERT INTO tblpeserta VALUES (4, 'Yoni', 'BRI',90); Query OK, 1 row affected (0.03 sec) mysql> INSERT INTO tblpeserta VALUES (5, 'Doni', 'POS',80); Query OK, 1 row affected (0.09 sec) mysql> select * from tblpeserta; +-----------+-------+---------------+----------+ | nopeserta | nama | kode_instansi | prestasi | +-----------+-------+---------------+----------+ | 1 | Dora | PLN | 98 | | 2 | Momon | PLN | 80 | | 3 | Arbi | BRI | 90 | | 4 | Yoni | BRI | 90 | | 5 | Doni | POS | 80 | +-----------+-------+---------------+----------+ 5 rows in set (0.00 sec) mysql> CREATE TABLE tblinstansi -> ( -> kd_instansi CHAR(5), -> nama_instansi CHAR(30), -> constraint fk_instansi primary key(kode_instansi) -> ); ERROR 1072 (42000): Key column 'kode_instansi' doesn't exist in table mysql> mysql> CREATE TABLE tblinstansi -> ( -> kd_instansi CHAR(5), -> nama_instansi CHAR(30), -> constraint fk_instansi primary key(kode_instansi)); ERROR 1072 (42000): Key column 'kode_instansi' doesn't exist in table mysql> CREATE TABLE tblinstansi -> ( -> kd_instansi CHAR(5), -> nama_instansi CHAR(30), -> constraint fk_instansi primary key (kode_instansi)); ERROR 1072 (42000): Key column 'kode_instansi' doesn't exist in table mysql> CREATE TABLE tblinstansi ( -> kode_instansi CHAR(5), -> nama_instansi CHAR(30), -> constraint fk_instansi primary key (kode_instansi)); Query OK, 0 rows affected (0.20 sec) mysql> INSERT INTO tblinstansi VALUES (1, 'PLN', Perusahaan Listrik Negar); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Listr ik Negar)' at line 1 mysql> INSERT INTO tblinstansi VALUES (2, 'BRI', Bank Rakyat Indonesia); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Rakya t Indonesia)' at line 1 mysql> INSERT INTO tblinstansi VALUES (3, 'POs', PT.Pos Indonesia); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Indon esia)' at line 1

mysql> mysql> INSERT INTO tblinstansi VALUES (1, 'PLN', 'Perusahaan Listrik Negar'); ERROR 1136 (21S01): Column count doesn't match value count at row 1 mysql> INSERT INTO tblinstansi VALUES (2, 'BRI', 'Bank Rakyat Indonesia'); ERROR 1136 (21S01): Column count doesn't match value count at row 1 mysql> INSERT INTO tblinstansi VALUES (3, 'POs', 'PT.Pos Indonesia'); ERROR 1136 (21S01): Column count doesn't match value count at row 1 mysql> INSERT INTO tblinstansi VALUES ('PLN', 'Perusahaan Listrik Negar'); Query OK, 1 row affected (0.08 sec) mysql> INSERT INTO tblinstansi VALUES ('BRI', 'Bank Rakyat Indonesia'); Query OK, 1 row affected (0.03 sec) mysql> INSERT INTO tblinstansi VALUES ('POs', 'PT.Pos Indonesia'); Query OK, 1 row affected (0.09 sec) mysql> select *from tblinstansi; +---------------+--------------------------+ | kode_instansi | nama_instansi | +---------------+--------------------------+ | BRI | Bank Rakyat Indonesia | | PLN | Perusahaan Listrik Negar | | POs | PT.Pos Indonesia | +---------------+--------------------------+ 3 rows in set (0.00 sec) mysql>

S-ar putea să vă placă și