Differentiation
Differentiation
-----------------------------------------------------------------------------------------
DDL stands for Data Definition Language. DML stands for Data Manipulation
Language.
DDL is used to create databases, schemas, DML is used to select, insert, update, or
constraints, users, tables, etc. delete records.
DDL has no further classification. DML is further classified into procedural DML
and non-procedural DML
Basic commands in DDL include CREATE, Basic commands in DDL include INSERT,
DROP, RENAME ,ALTER etc SELECT, UPDATE ,DELETE etc
CHAR VARCHAR
Used to store character strings of fixed Used to store character strings of variable
length. length.
In CHAR, if the length of the string is In VARCHAR, if the length of the string is
less than the fixed length, it is padded less than the defined length, it is stored as
with extra spaces. is, without being padded with extra spaces.
Variable size; The storage size of the
Fixed size; The storage size of CHAR VARCHAR datatype is equal to the actual
datatypes is equal to the defined length (n length of the entered string in bytes.
bytes).
VARCHAR may be slower due to the need
CHAR is generally faster because it does not for memory allocation according to the
require memory allocation for varying actual length of the data.
lengths