Created
March 10, 2022 15:13
-
-
Save gusmantap/3679215008ad7e684d8c237051f3c926 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE IF NOT EXISTS belajar; | |
USE belajar; | |
DROP TABLE IF EXISTS customers; | |
CREATE TABLE IF NOT EXISTS customers( | |
id int PRIMARY KEY AUTO_INCREMENT, | |
nama VARCHAR(255) NOT NULL, | |
alamat VARCHAR(255) NOT NULL, | |
kota VARCHAR(255) NOT NULL, | |
negara VARCHAR(255) NOT NULL | |
); | |
INSERT INTO customers(nama, alamat, kota, negara) | |
VALUES ('Bagus Mantonafi', 'Jalan Pulau Saelus', 'Denpasar', 'Indonesia'), | |
('Hendry', 'Jalan Watturenggong', 'Denpasar', 'Indonesia'), | |
('John Doe', 'St. sixth nine', 'New York', 'USA'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM customers; | |
/** penggunaan tanda * (bintang) artinya digunakan memilih semua field **/ | |
SELECT nama, kota FROM customers; | |
/** nama dan kota merupakan sebuah nama_field **/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Syntax dasar SELECT **/ | |
SELECT * FROM nama_tabel | |
/** ATAU **/ | |
/** Syntax dasar SELECT **/ | |
SELECT nama_field, nama_field, nama_field FROM nama_tabel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment