- Create Database
Syntax dasar:
CREATE DATABASE database_nama
Contoh:
CREATE DATABASE databaseku
- Create Table
Syntax dasar:
CREATE TABLE
(
Column_name1 table_nama data_type
Column_name2 table_nama data_type
Column_name3 table_nama data_type
)
Contoh:
CREATE TABLE bukutamu
(
Id int,
Nama varchar (255),
Email varchar(50),
Kota varchar(255)
)
- Select
Syntax dasar:
SELECT column_name(s)
FROM table_name
Atau
SELECT * FROM table_name
Contoh 1:
SELECT nama,email FROM bukutamu
Contoh 2:
SELECT * FROM bukutamu
- Select Distinct
Syntax dasar:
SELECT DISTINCT column_name(s)
FROM table_name
Contoh:
SELECT DISTINCT kota FROM bukutamu
- Where
Syntax dasar:
SELECT column name(s)
FROM table_name
WHERE column_name operator value
Contoh:
SELECT * FROM bukutamu
WHERE kota=’YOGYAKARTA’
- Order By