Professional Documents
Culture Documents
Write DDL & DML Queries: Here Are Some Important DML Commands in SQL
Write DDL & DML Queries: Here Are Some Important DML Commands in SQL
DML
INSERT:
This is a statement is a SQL query. This command is used to insert data into the
row of a table.
Syntax:
INSERT INTO students (RollNo, FIrstName, LastName) VALUES ('60', 'Tom', Erichsen');
UPDATE:
This command is used to update or modify the value of a column in the table.
Syntax:
UPDATE students
ITM ASSIGNMENT
BPIT
DELETE:
This command is used to remove one or more rows from a table.
Syntax:
DDL
Example
Views
Schemas
Tables
Indexes
1. CREATE
2. DROP
3. ALTER
4. TRUNCATE
CREATE
CREATE statements is used to define the database structure schema:
Syntax:
ITM ASSIGNMENT
BPIT
Syntax
DROP TABLE;
For example:
Syntax:
Syntax:
ITM ASSIGNMENT
BPIT
Basis
Full-Form The full form of DDL is Data Definition The full form of DML is Data Ma
Language. Language.
Categorization The DDL commands have no further The DML commands are cla
classification. procedural and non-
(declarative) DMLs.
Command uses The commonly used commands under DDL The commonly used commands
language are: language are:
o CREATE o INSERT
o DROP o UPDATE
o ALTER o DELETE
o TRUNCATE o SELECT
o RENAME
Auto-commit DDL commands are auto-committed, so DML commands are not auto-c
changes that happen in the database will be so database changes are not per
permanent.
Rollback DDL commands made changes permanent; DML commands do not mak
therefore, we cannot roll back these permanent; therefore, rollback
statements. for these statements.
WHERE clause DDL commands have no use of a WHERE The DML statements can use a WHERE
clause because here, filtration of records is clause while manipulating data in a
not possible. database.
Effect The DDL command affects the entire The DML commands will affect the single or
database or table. multiple records based on the specified
condition.
ITM ASSIGNMENT