DDL (Data Definition Language)
DDL or Data Definition Language actually consists of the SQL commands that can be used to define the database schema. It simply deals with descriptions of the database schema and is used to create and modify the structure of database objects in the database.
DDL is a set of SQL commands used to create, modify, and delete database structures but not data. These commands are normally not used by a general user, who should be accessing the database via an application.
List of DDL Commands:
Here are all the main DDL (Data Definition Language) commands along with their syntax:
Command | Description | Syntax |
---|---|---|
CREATE | Create database or its objects (table, index, function, views, store procedure, and triggers) | CREATE TABLE table_name (column1 data_type, column2 data_type, ...); |
DROP | Delete objects from the database | DROP TABLE table_name; |
ALTER | Alter the structure of the database | ALTER TABLE table_name ADD COLUMN column_name data_type; |
TRUNCATE | Remove all records from a table, including all spaces allocated for the records are removed | TRUNCATE TABLE table_name; |
COMMENT | Add comments to the data dictionary | COMMENT 'comment_text' ON TABLE table_name; |
RENAME | Rename an object existing in the database | RENAME TABLE old_table_name TO new_table_name; |
DML (Data Manipulation Language)
The SQL commands that deal with the manipulation of data present in the database belong to DML or Data Manipulation Language and this includes most of the SQL statements.
It is the component of the SQL statement that controls access to data and to the database. Basically, DCL statements are grouped with DML statements.
List of DML commands
Here are all the main DML (Data Manipulation Language) commands along with their syntax:
Command | Description | Syntax |
---|---|---|
INSERT | Insert data into a table | INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...); |
UPDATE | Update existing data within a table | UPDATE table_name SET column1 = value1, column2 = value2 WHERE condition; |
DELETE | Delete records from a database table | DELETE FROM table_name WHERE condition; |
LOCK | Table control concurrency | LOCK TABLE table_name IN lock_mode; |
CALL | Call a PL/SQL or JAVA subprogram | CALL procedure_name(arguments); |
EXPLAIN PLAN | Describe the access path to data | EXPLAIN PLAN FOR SELECT * FROM table_name; |
0 Comments
Please do note create link post in comment section