Script for database (Data Manipilation Language)
Example the table of database is IDENTITY :
CREATE TABLE IDENTITY(
NAMES VARCHAR(50),
AGE INTEGER,
ADDRESS VARCHAR(100));
This is script for insert, update and delete data from table of database:
VALUES (...., ...., ....)
or
INSERT INTO Table_Name (Field1, Field2,.....)
VALUES (...., ...., ....)
Example:
INSERT INTO IDENTITY
VALUES ('Fuji', 20, 'Indonesia');
or
INSERT INTO IDENTITY (NAMES,AGE,ADDRESS)
VALUES ('Fuji', 20, 'Indonesia');
SET
Field1 = ....,
Field2 = ....
WHERE Conditions
Example:
UPDATE IDENTITY
SET
AGE = 21,
ADDRESS = 'Yogyakarta'
WHERE NAMES = 'Fuji';
SET
Field1 = ....,
Field2 = ....
Example:
UPDATE IDENTITY
SET
AGE = 21,
ADDRESS = 'Yogyakarta'
WHERE Conditions
Example:
DELETE FROM IDENTITY
WHERE NAMES = 'Fuji';
Example:
DELETE FROM IDENTITY
CREATE TABLE IDENTITY(
NAMES VARCHAR(50),
AGE INTEGER,
ADDRESS VARCHAR(100));
This is script for insert, update and delete data from table of database:
- Insertion
VALUES (...., ...., ....)
or
INSERT INTO Table_Name (Field1, Field2,.....)
VALUES (...., ...., ....)
Example:
INSERT INTO IDENTITY
VALUES ('Fuji', 20, 'Indonesia');
or
INSERT INTO IDENTITY (NAMES,AGE,ADDRESS)
VALUES ('Fuji', 20, 'Indonesia');
- Update one row
SET
Field1 = ....,
Field2 = ....
WHERE Conditions
Example:
UPDATE IDENTITY
SET
AGE = 21,
ADDRESS = 'Yogyakarta'
WHERE NAMES = 'Fuji';
- Update all rows
SET
Field1 = ....,
Field2 = ....
Example:
UPDATE IDENTITY
SET
AGE = 21,
ADDRESS = 'Yogyakarta'
- Delete one row
WHERE Conditions
Example:
DELETE FROM IDENTITY
WHERE NAMES = 'Fuji';
- Delete all rows
Example:
DELETE FROM IDENTITY
No comments