SlideShare a Scribd company logo
MySQL console
DDL (create, alter, drop)
DML (select, insert, update, delete)
1. Buat database perpus
2. Buat tabel buku
- kode_buku char(5)
- nama_buku varchar(30)
- judul varchar(30)
3. Buat tabel anggota
- id varchar(6) primary key
- nama varchar(30)
- alamat varchar(20)
- kelas varchar(10)
4. Tambahkan field pengarang di tabel buku dengan tipe data varchar(30)
5. Ubah judul di tabel buku menjadi judul_buku dgn tipe data yang sama
6. Ubah tipe data nama di tabel anggota menjadi char(35)
7. Isi 1 data pada tabel anggota
8. Tampilkan isi data
9. Tampilkan tabel dan descriptions yang ada di database perpus
===========================================================================
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 12
Server version: 5.5.20-log MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> create database perpus;
Query OK, 1 row affected (0.00 sec)
mysql> use perpus;
Database changed
mysql> create table buku (kode_buku char(5), nama_buku varchar(30), judul
varchar(30));
Query OK, 0 rows affected (0.13 sec)
mysql> create table anggota (id varchar(6), nama varchar(30), alamat
varchar(20), kelas varchar(10));
Query OK, 0 rows affected (0.00 sec)
mysql> alter table buku add pengarang varchar(30);
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table buku change judul judul_buku varchar(30);
Query OK, 0 rows affected (0.08 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table anggota modify nama char(35);
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> insert into anggota values('080194','Yobby','Purnama','12.2F.30');
Query OK, 1 row affected (0.05 sec)
mysql> select *from anggota;
+--------+-------+---------+----------+
| id | nama | alamat | kelas |
+--------+-------+---------+----------+
| 080194 | Yobby | Purnama | 12.2F.30 |
+--------+-------+---------+----------+
1 row in set (0.00 sec)
mysql> show tables;
+------------------+
| Tables_in_perpus |
+------------------+
| anggota |
| buku |
+------------------+
2 rows in set (0.00 sec)
mysql> alter table anggota add primary key(id);
Query OK, 1 row affected (0.08 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> desc anggota;
+--------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| id | varchar(6) | NO | PRI | | |
| nama | char(35) | YES | | NULL | |
| alamat | varchar(20) | YES | | NULL | |
| kelas | varchar(10) | YES | | NULL | |
+--------+-------------+------+-----+---------+-------+
4 rows in set (0.05 sec)
mysql> desc buku;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| kode_buku | char(5) | YES | | NULL | |
| nama_buku | varchar(30) | YES | | NULL | |
| judul_buku | varchar(30) | YES | | NULL | |
| pengarang | varchar(30) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
4 rows in set (0.02 sec)
mysql>

More Related Content

What's hot

My sql statements by okello erick
My sql statements by okello erickMy sql statements by okello erick
My sql statements by okello erick
okelloerick
 
Data Munging in R - Chicago R User Group
Data Munging in R - Chicago R User GroupData Munging in R - Chicago R User Group
Data Munging in R - Chicago R User Group
designandanalytics
 
interfaz
interfazinterfaz
interfaz
OfeCarrera
 
Applied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System PresentationApplied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System Presentation
Richard Crowley
 
Lecture3 mysql gui by okello erick
Lecture3 mysql gui by okello erickLecture3 mysql gui by okello erick
Lecture3 mysql gui by okello erick
okelloerick
 
The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180
Mahmoud Samir Fayed
 
Python data structures
Python data structuresPython data structures
Python data structures
Harry Potter
 
Efficient Use of indexes in MySQL
Efficient Use of indexes in MySQLEfficient Use of indexes in MySQL
Efficient Use of indexes in MySQL
Aleksandr Kuzminsky
 
MySQL Functions
MySQL FunctionsMySQL Functions
MySQL Functions
Compare Infobase Limited
 
Moose Lightning Talk
Moose Lightning TalkMoose Lightning Talk
Moose Lightning Talk
Mike Whitaker
 
Python Day1
Python Day1Python Day1
Python Day1
Mantavya Gajjar
 
1. python
1. python1. python
1. python
PRASHANT OJHA
 
Introduction databases and MYSQL
Introduction databases and MYSQLIntroduction databases and MYSQL
Introduction databases and MYSQL
Naeem Junejo
 

What's hot (13)

My sql statements by okello erick
My sql statements by okello erickMy sql statements by okello erick
My sql statements by okello erick
 
Data Munging in R - Chicago R User Group
Data Munging in R - Chicago R User GroupData Munging in R - Chicago R User Group
Data Munging in R - Chicago R User Group
 
interfaz
interfazinterfaz
interfaz
 
Applied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System PresentationApplied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System Presentation
 
Lecture3 mysql gui by okello erick
Lecture3 mysql gui by okello erickLecture3 mysql gui by okello erick
Lecture3 mysql gui by okello erick
 
The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180
 
Python data structures
Python data structuresPython data structures
Python data structures
 
Efficient Use of indexes in MySQL
Efficient Use of indexes in MySQLEfficient Use of indexes in MySQL
Efficient Use of indexes in MySQL
 
MySQL Functions
MySQL FunctionsMySQL Functions
MySQL Functions
 
Moose Lightning Talk
Moose Lightning TalkMoose Lightning Talk
Moose Lightning Talk
 
Python Day1
Python Day1Python Day1
Python Day1
 
1. python
1. python1. python
1. python
 
Introduction databases and MYSQL
Introduction databases and MYSQLIntroduction databases and MYSQL
Introduction databases and MYSQL
 

Similar to MySQL Console - Dasar I

My sql1
My sql1My sql1
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
webhostingguy
 
MySQL constraints
MySQL constraintsMySQL constraints
MySQL constraints
Harish Gyanani
 
Materi my sql part 1
Materi my sql part 1Materi my sql part 1
Materi my sql part 1
Amar Senjaku Ofdetraisar
 
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
 Design and Develop SQL DDL statements which demonstrate the use of SQL objec... Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
bhavesh lande
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinh
webhostingguy
 
mysqlHiep.ppt
mysqlHiep.pptmysqlHiep.ppt
mysqlHiep.ppt
webhostingguy
 
Intro to my sql
Intro to my sqlIntro to my sql
Intro to my sql
sagaroceanic11
 
mysql-Tutorial with Query presentation.ppt
mysql-Tutorial with Query presentation.pptmysql-Tutorial with Query presentation.ppt
mysql-Tutorial with Query presentation.ppt
aptechaligarh
 
DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018
DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018
DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018
teachersduniya.com
 
DPC18 - Making the most out of MySQL
DPC18 - Making the most out of MySQLDPC18 - Making the most out of MySQL
DPC18 - Making the most out of MySQL
Gabriela Ferrara
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
SunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLSunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQL
Gabriela Ferrara
 
MySQL's JSON Data Type and Document Store
MySQL's JSON Data Type and Document StoreMySQL's JSON Data Type and Document Store
MySQL's JSON Data Type and Document Store
Dave Stokes
 
Unit_III_SQL-MySQL-Commands-Basic.pptx usefull
Unit_III_SQL-MySQL-Commands-Basic.pptx  usefullUnit_III_SQL-MySQL-Commands-Basic.pptx  usefull
Unit_III_SQL-MySQL-Commands-Basic.pptx usefull
ANTOARA2211003040050
 
Introduction To MySQL Lecture 1
Introduction To MySQL Lecture 1Introduction To MySQL Lecture 1
Introduction To MySQL Lecture 1
Ajay Khatri
 
SQL Tutorial for BCA-2
SQL Tutorial for BCA-2SQL Tutorial for BCA-2
SQL Tutorial for BCA-2
Raj vardhan
 
Introduction To Lamp P2
Introduction To Lamp P2Introduction To Lamp P2
Introduction To Lamp P2
Amzad Hossain
 
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Tesora
 
MySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That BiteMySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That Bite
Ronald Bradford
 

Similar to MySQL Console - Dasar I (20)

My sql1
My sql1My sql1
My sql1
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
MySQL constraints
MySQL constraintsMySQL constraints
MySQL constraints
 
Materi my sql part 1
Materi my sql part 1Materi my sql part 1
Materi my sql part 1
 
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
 Design and Develop SQL DDL statements which demonstrate the use of SQL objec... Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinh
 
mysqlHiep.ppt
mysqlHiep.pptmysqlHiep.ppt
mysqlHiep.ppt
 
Intro to my sql
Intro to my sqlIntro to my sql
Intro to my sql
 
mysql-Tutorial with Query presentation.ppt
mysql-Tutorial with Query presentation.pptmysql-Tutorial with Query presentation.ppt
mysql-Tutorial with Query presentation.ppt
 
DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018
DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018
DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018
 
DPC18 - Making the most out of MySQL
DPC18 - Making the most out of MySQLDPC18 - Making the most out of MySQL
DPC18 - Making the most out of MySQL
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
 
SunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLSunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQL
 
MySQL's JSON Data Type and Document Store
MySQL's JSON Data Type and Document StoreMySQL's JSON Data Type and Document Store
MySQL's JSON Data Type and Document Store
 
Unit_III_SQL-MySQL-Commands-Basic.pptx usefull
Unit_III_SQL-MySQL-Commands-Basic.pptx  usefullUnit_III_SQL-MySQL-Commands-Basic.pptx  usefull
Unit_III_SQL-MySQL-Commands-Basic.pptx usefull
 
Introduction To MySQL Lecture 1
Introduction To MySQL Lecture 1Introduction To MySQL Lecture 1
Introduction To MySQL Lecture 1
 
SQL Tutorial for BCA-2
SQL Tutorial for BCA-2SQL Tutorial for BCA-2
SQL Tutorial for BCA-2
 
Introduction To Lamp P2
Introduction To Lamp P2Introduction To Lamp P2
Introduction To Lamp P2
 
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
 
MySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That BiteMySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That Bite
 

More from Roni Darmanto

Sejarah Singkat Perlawanan Panggi dan Ruguk Tahun 1908
Sejarah Singkat Perlawanan Panggi dan Ruguk Tahun 1908Sejarah Singkat Perlawanan Panggi dan Ruguk Tahun 1908
Sejarah Singkat Perlawanan Panggi dan Ruguk Tahun 1908
Roni Darmanto
 
Analisis Sistem Informasi Absensi Pegawai Pada CU. Keling Kumang BO. Labung L...
Analisis Sistem Informasi Absensi Pegawai Pada CU. Keling Kumang BO. Labung L...Analisis Sistem Informasi Absensi Pegawai Pada CU. Keling Kumang BO. Labung L...
Analisis Sistem Informasi Absensi Pegawai Pada CU. Keling Kumang BO. Labung L...
Roni Darmanto
 
Makalah perancangan web (website 5 k lapak)
Makalah perancangan web (website 5 k lapak) Makalah perancangan web (website 5 k lapak)
Makalah perancangan web (website 5 k lapak)
Roni Darmanto
 
PKL (Pelayanan Publik Pemerintah)
PKL (Pelayanan Publik Pemerintah)PKL (Pelayanan Publik Pemerintah)
PKL (Pelayanan Publik Pemerintah)
Roni Darmanto
 
PKL (Merakit Personal PC)
PKL (Merakit Personal PC)PKL (Merakit Personal PC)
PKL (Merakit Personal PC)
Roni Darmanto
 
Peluang Bisnis Counter Handphone
Peluang Bisnis Counter HandphonePeluang Bisnis Counter Handphone
Peluang Bisnis Counter Handphone
Roni Darmanto
 
Proposal Pembiakan Ikan Bawal
Proposal Pembiakan Ikan BawalProposal Pembiakan Ikan Bawal
Proposal Pembiakan Ikan Bawal
Roni Darmanto
 
Merancang Web BAB III
Merancang Web BAB IIIMerancang Web BAB III
Merancang Web BAB III
Roni Darmanto
 
Sejarah Sintang
Sejarah SintangSejarah Sintang
Sejarah Sintang
Roni Darmanto
 
Tutorial Internet Banking
Tutorial Internet BankingTutorial Internet Banking
Tutorial Internet Banking
Roni Darmanto
 

More from Roni Darmanto (10)

Sejarah Singkat Perlawanan Panggi dan Ruguk Tahun 1908
Sejarah Singkat Perlawanan Panggi dan Ruguk Tahun 1908Sejarah Singkat Perlawanan Panggi dan Ruguk Tahun 1908
Sejarah Singkat Perlawanan Panggi dan Ruguk Tahun 1908
 
Analisis Sistem Informasi Absensi Pegawai Pada CU. Keling Kumang BO. Labung L...
Analisis Sistem Informasi Absensi Pegawai Pada CU. Keling Kumang BO. Labung L...Analisis Sistem Informasi Absensi Pegawai Pada CU. Keling Kumang BO. Labung L...
Analisis Sistem Informasi Absensi Pegawai Pada CU. Keling Kumang BO. Labung L...
 
Makalah perancangan web (website 5 k lapak)
Makalah perancangan web (website 5 k lapak) Makalah perancangan web (website 5 k lapak)
Makalah perancangan web (website 5 k lapak)
 
PKL (Pelayanan Publik Pemerintah)
PKL (Pelayanan Publik Pemerintah)PKL (Pelayanan Publik Pemerintah)
PKL (Pelayanan Publik Pemerintah)
 
PKL (Merakit Personal PC)
PKL (Merakit Personal PC)PKL (Merakit Personal PC)
PKL (Merakit Personal PC)
 
Peluang Bisnis Counter Handphone
Peluang Bisnis Counter HandphonePeluang Bisnis Counter Handphone
Peluang Bisnis Counter Handphone
 
Proposal Pembiakan Ikan Bawal
Proposal Pembiakan Ikan BawalProposal Pembiakan Ikan Bawal
Proposal Pembiakan Ikan Bawal
 
Merancang Web BAB III
Merancang Web BAB IIIMerancang Web BAB III
Merancang Web BAB III
 
Sejarah Sintang
Sejarah SintangSejarah Sintang
Sejarah Sintang
 
Tutorial Internet Banking
Tutorial Internet BankingTutorial Internet Banking
Tutorial Internet Banking
 

Recently uploaded

一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
xclpvhuk
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
v7oacc3l
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
slg6lamcq
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
eoxhsaa
 
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
oaxefes
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
aqzctr7x
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
soxrziqu
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
Timothy Spann
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
hyfjgavov
 
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
ywqeos
 
Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
ElizabethGarrettChri
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
bopyb
 
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理 原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
tzu5xla
 
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
lzdvtmy8
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
Vietnam Cotton & Spinning Association
 

Recently uploaded (20)

一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
 
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
 
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
 
Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
 
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理 原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
 
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
 

MySQL Console - Dasar I

  • 1. MySQL console DDL (create, alter, drop) DML (select, insert, update, delete) 1. Buat database perpus 2. Buat tabel buku - kode_buku char(5) - nama_buku varchar(30) - judul varchar(30) 3. Buat tabel anggota - id varchar(6) primary key - nama varchar(30) - alamat varchar(20) - kelas varchar(10) 4. Tambahkan field pengarang di tabel buku dengan tipe data varchar(30) 5. Ubah judul di tabel buku menjadi judul_buku dgn tipe data yang sama 6. Ubah tipe data nama di tabel anggota menjadi char(35) 7. Isi 1 data pada tabel anggota 8. Tampilkan isi data 9. Tampilkan tabel dan descriptions yang ada di database perpus =========================================================================== Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 12 Server version: 5.5.20-log MySQL Community Server (GPL) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. mysql> create database perpus; Query OK, 1 row affected (0.00 sec) mysql> use perpus; Database changed mysql> create table buku (kode_buku char(5), nama_buku varchar(30), judul varchar(30)); Query OK, 0 rows affected (0.13 sec) mysql> create table anggota (id varchar(6), nama varchar(30), alamat varchar(20), kelas varchar(10)); Query OK, 0 rows affected (0.00 sec) mysql> alter table buku add pengarang varchar(30);
  • 2. Query OK, 0 rows affected (0.01 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> alter table buku change judul judul_buku varchar(30); Query OK, 0 rows affected (0.08 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> alter table anggota modify nama char(35); Query OK, 0 rows affected (0.01 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> insert into anggota values('080194','Yobby','Purnama','12.2F.30'); Query OK, 1 row affected (0.05 sec) mysql> select *from anggota; +--------+-------+---------+----------+ | id | nama | alamat | kelas | +--------+-------+---------+----------+ | 080194 | Yobby | Purnama | 12.2F.30 | +--------+-------+---------+----------+ 1 row in set (0.00 sec) mysql> show tables; +------------------+ | Tables_in_perpus | +------------------+ | anggota | | buku | +------------------+ 2 rows in set (0.00 sec) mysql> alter table anggota add primary key(id); Query OK, 1 row affected (0.08 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> desc anggota; +--------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+-------------+------+-----+---------+-------+ | id | varchar(6) | NO | PRI | | | | nama | char(35) | YES | | NULL | | | alamat | varchar(20) | YES | | NULL | | | kelas | varchar(10) | YES | | NULL | | +--------+-------------+------+-----+---------+-------+ 4 rows in set (0.05 sec) mysql> desc buku; +------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+-------------+------+-----+---------+-------+ | kode_buku | char(5) | YES | | NULL | | | nama_buku | varchar(30) | YES | | NULL | | | judul_buku | varchar(30) | YES | | NULL | | | pengarang | varchar(30) | YES | | NULL | | +------------+-------------+------+-----+---------+-------+
  • 3. 4 rows in set (0.02 sec) mysql>