Tugas2 syntax.docx - Setting environment for using XAMPP for Windows [email protected] c\xampp MYSQL-u root-p Enter password Welcome to the MariaDB

Tugas2 syntax.docx - Setting environment for using XAMPP...

This preview shows page 1 - 4 out of 12 pages.

Setting environment for using XAMPP for Windows. Agushryn @agushryn99 c:\xampp # MYSQL -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.8-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 | +--------------------+ | 181051037_jm1 | | information_schema | | mysql | | performance_schema | | phpmyadmin | | test | +--------------------+ 6 rows in set (0.040 sec) MariaDB [(none)]> create database tugas2_jm1_181051037; Query OK, 1 row affected (0.005 sec) MariaDB [(none)]> use tugas2_jm1_181051037; Database changed MariaDB [tugas2_jm1_181051037]> create table t_buku(kode_buku varchar(5) primary key, judul_buku varchar(20)); Query OK, 0 rows affected (0.057 sec)
Image of page 1
MariaDB [tugas2_jm1_181051037]> insert into t_buku values('BK101','AMBONESIA'), ('BK102','YOU'),('BK103','WHO IAM I'),('BK104','DINDAKU'),('BK105','I AM HUMAN'), ('BK106','ANAK MANUSIA'); Query OK, 6 rows affected (0.010 sec) Records: 6 Duplicates: 0 Warnings: 0 MariaDB [tugas2_jm1_181051037]> insert into t_buku values('BK107','EAST INDONESIA'), ('BK108','HALLO'),('BK109','FRIENDS'),('BK110','THE FIRST'); Query OK, 4 rows affected (0.009 sec) Records: 4 Duplicates: 0 Warnings: 0 MariaDB [tugas2_jm1_181051037]> select*from t_buku; +-----------+----------------+ | kode_buku | judul_buku | +-----------+----------------+ | BK101 | AMBONESIA | | BK102 | YOU | | BK103 | WHO IAM I | | BK104 | DINDAKU | | BK105 | I AM HUMAN | | BK106 | ANAK MANUSIA | | BK107 | EAST INDONESIA | | BK108 | HALLO | | BK109 | FRIENDS | | BK110 | THE FIRST | +-----------+----------------+ 10 rows in set (0.007 sec) MariaDB [tugas2_jm1_181051037]> create table t_penulis(id_penulis varchar(5) primary key, kode_buku varchar(5), judul_buku varchar(20), foreign key(kode_buku) references t_buku(kode_buku)); Query OK, 0 rows affected (0.087 sec) MariaDB [tugas2_jm1_181051037]> desc t_penulis; +------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra |
Image of page 2
+------------+-------------+------+-----+---------+-------+ | id_penulis | varchar(5) | NO | PRI | NULL | | | kode_buku | varchar(5) | YES | MUL | NULL | | | judul_buku | varchar(20) | YES | | NULL | | +------------+-------------+------+-----+---------+-------+ 3 rows in set (0.043 sec) MariaDB [tugas2_jm1_181051037]> insert into t_penulis values('PN901','BK107','EAST INDONESIA'),('PN902','BK106','ANAK MANUSIA'),('PN903','BK109','FRIENDS'), ('PN904','BK101','AMBONESIA'); Query OK, 4 rows affected (0.010 sec) Records: 4 Duplicates: 0 Warnings: 0 MariaDB [tugas2_jm1_181051037]> insert into t_buku values('PN105','BK110','THE FIRST'),('PN106','BK102','YOU'),('PN107','BK108','HALLO'),('PN108','BK104','DINDAKU'), ('PN109','BK103','WHO IAM I'),('PN110','BK105','I AM HUMAN'); ERROR 1136 (21S01): Column count doesn't match value count at row 1 MariaDB [tugas2_jm1_181051037]> SELECT*FROM t_penulis; +------------+-----------+----------------+ | id_penulis | kode_buku | judul_buku | +------------+-----------+----------------+ | PN901 | BK107 | EAST INDONESIA |
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 12 pages?

  • Summer '19
  • agusharyono

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes