Interview Preparation mode beta
Funny Facebook Status Funny Facebook Status
Enter your email address

What is the difference between DDL and DML commands? Can you name some examples of each?

5 Answers

Nice?Vote!
*    DDL commands are data definition language commands.  Examples are CREATE, ALTER and DROP.
*    DML commands are data manipulation language commands.  Examples are SELECT, INSERT, UPDATE and DELETE.
answered 1 year ago by R (19,530 points)
Nice?Vote!
sql is a universally accepeted query language whic acts an interface to the relational databases to fetch,insert and manipulate the data existing in the database.
sql encompasses of five parts

1.Data Retrieval Language:the commands used to select data from the database.this includes
 a.select

2.Data manipulation Language:commands to manipulate the data existing in the database.commands in this are
 a.insert
 b.update
 c.delete
 d.merge

3.Data Definition Language:commands to define and create the database ojects like tables ,views etc.commands in this are
 a.create
 b.truncate
 c.alter
 d.drop
 e.describe
 f.rename

4.Tranaction control Language:the commands in this are
 a.grant
 b.revoke

5.Data Control Language:the commands in this are
 a.Commit
 b.Rollback
 c.Savepoint.
answered 1 year ago by R (19,530 points)
Nice?Vote!
DDL : CREATE, ALTER, DROP
DML : INSERT, UPDATE, DELETE
DCL : GRANT, REVOKE
TCL : COMMIT, SAVE POINT, ROLLBACK
DQL : SELECT
answered 1 year ago by R (19,530 points)
Nice?Vote!
+ DDL (Data Definition Language) COMMANDS include CREATE,ALTER,DROP AND TRUNCATE. they are used for defining the data.
Some examples:
* CREATE - to create objects in the database
* ALTER - alters the structure of the database
* DROP - delete objects from the database
* TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
* COMMENT - add comments to the data dictionary
* RENAME - rename an object

+ DML (Data Manipulation Language) COMMANDS include SELECT, INSERT, UPDATE, DELETE, MERGE, CALL, EXPLAIN PLAN, LOCK TABLE , they are used for data manipulation.
Some examples:

* SELECT - retrieve data from the a database
* INSERT - insert data into a table
* UPDATE - updates existing data within a table
* DELETE - deletes all records from a table, the space for the records remain
* MERGE - UPSERT operation (insert or update)
* CALL - call a PL/SQL or Java subprogram
* EXPLAIN PLAN - explain access path to data
* LOCK TABLE - control concurrency

+ TCL (Transaction Control) include ROLLBACK, COMMIT .... They are used to manage the changes made by DML statements.

Some examples:
* COMMIT - save work done
* SAVEPOINT - identify a point in a transaction to which you can later roll back
* ROLLBACK - restore database to original since the last COMMIT
* SET TRANSACTION - Change transaction options like isolation level and what rollback segment to use

+ DCL (Data Control Language) include GRANT, REVOKE... They are used for the control of data.
Some examples:

* GRANT - gives users access privileges to database
* REVOKE - withdraw access privileges given with the GRANT command
answered 1 year ago by anonymous
Nice?Vote!
DML

DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database.

Examples: SELECT, UPDATE, INSERT statements

DDL

DDL is abbreviation of Data Definition Language. It is used to create and modify the structure of database objects in database.

Examples: CREATE, ALTER, DROP statements

DCL

DCL is abbreviation of Data Control Language. It is used to create roles, permissions, and referential integrity as well it is used to control access to database by securing it.

Examples: GRANT, REVOKE statements

TCL

TCL is abbreviation of Transactional Control Language. It is used to manage different transactions occurring within a database.

Examples: COMMIT, ROLLBACK statements
answered 1 year ago by anonymous

Related questions