Selamat malam gan, gimana
kabarnya baik bukan oh yah gan pada kesempatan kali ini saya akan sedikit berbagi
untuk agan-agan yang sedang menambah pengetahuan ataupun yang sedang lagi bingung
tentang perintah – perintah sql query yang biasa digunakan pada aplikasi
database kali ini saya akan bagikan perintah untuk apliaksi MS.Access, dimana
Microscof Access (Microscoft Office Acces) adalah sebuah aplikasi basis data
relasional yang memppunyai salah satu keunggulan kompabilitasnya dengan bahasa
pemrograman Sctructured Query Language (SQL), dan statement SQL yang dapat digunakan
secara langsung di dalam Macro dan VBA Module untuk secara langsung
memanipulasi table dalam. Okeh gan segitu saja pengenalan sedikit tentang
aplikasi Microscoft Office Access dan langsung saja berikut daftar perintah Sctructured
Query Language (SQL).
Select
Pernyataan
SQL SELECT digunakan untuk query atau mengambil data dari tabel dalam database,
berikut macam – macam perintah Select
Select Statement
SELECT "column_name" FROM "table_name"
Distinct
SELECT DISTINCT "column_name"
FROM "table_name"
SELECT DISTINCT "column_name"
FROM "table_name"
Where
SELECT "column_name"
FROM "table_name"
WHERE "condition"
SELECT "column_name"
FROM "table_name"
WHERE "condition"
And/Or
SELECT "column_name"
FROM "table_name"
WHERE "simple condition"
{[AND|OR] "simple condition"}+
SELECT "column_name"
FROM "table_name"
WHERE "simple condition"
{[AND|OR] "simple condition"}+
In
SELECT "column_name"
FROM "table_name"
WHERE "column_name" IN ('value1', 'value2', ...)
SELECT "column_name"
FROM "table_name"
WHERE "column_name" IN ('value1', 'value2', ...)
Between
SELECT "column_name"
FROM "table_name"
WHERE "column_name" BETWEEN 'value1' AND 'value2'
SELECT "column_name"
FROM "table_name"
WHERE "column_name" BETWEEN 'value1' AND 'value2'
Like
SELECT "column_name"
FROM "table_name"
WHERE "column_name" LIKE {PATTERN}
SELECT "column_name"
FROM "table_name"
WHERE "column_name" LIKE {PATTERN}
Order By
SELECT "column_name"
FROM "table_name"
[WHERE "condition"]
ORDER BY "column_name" [ASC, DESC]
SELECT "column_name"
FROM "table_name"
[WHERE "condition"]
ORDER BY "column_name" [ASC, DESC]
Count
SELECT COUNT("column_name")
FROM "table_name"
SELECT COUNT("column_name")
FROM "table_name"
Group By
SELECT "column_name1", SUM("column_name2")
FROM "table_name"
GROUP BY "column_name1"
SELECT "column_name1", SUM("column_name2")
FROM "table_name"
GROUP BY "column_name1"
Having
SELECT "column_name1", SUM("column_name2")
FROM "table_name"
GROUP BY "column_name1"
HAVING (arithematic function condition)
SELECT "column_name1", SUM("column_name2")
FROM "table_name"
GROUP BY "column_name1"
HAVING (arithematic function condition)
Create Table Statement
Pernyataan Create Table diguanakan untuk membuat sebuah tabel dalam database.
CREATE TABLE "table_name"
("column 1" "data_type_for_column_1",
"column 2" "data_type_for_column_2",
... )
Drop Table Statement
Pernyataan Delete Table Digunakan untuk menghapus salah satu tabel yang ada dalam database.
DROP TABLE "table_name"
Truncate Table Statement
TRUNCATE TABLE "table_name"
TRUNCATE TABLE "table_name"
Insert Into Statement
Pernyataan Insert biasa digunakan untuk pengisian record atau data dalam tabel.
INSERT INTO "table_name" ("column1", "column2", ...)
VALUES ("value1", "value2", ...)
Update Statement
Pernyataan Update biasa digunakan untuk pengubahan column dalam tabel.
UPDATE "table_name"
SET "column_1" = [new value]
WHERE {condition}
SET "column_1" = [new value]
WHERE {condition}
Delete From Statement
Pernyataan Insert biasa digunakan untuk penghapusan tabel dalam database.
DELETE FROM "table_name"
WHERE {condition}
WHERE {condition}
0 Response to "Perintah - perintah Structured Query Language (SQL) pada Microscoft Office Access"
Catat Ulasan
good