What is DDL and DML ?
This is an important questions from Interview's point of view as this tests the basics of your databases. Once you can answer them what is DDL and what is DML, than they will ask you to give examples and than will move to SQL statements. Normally interviewer tends to build on questions... So here we go
Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
1. CREATE - to create objects in the database 2. ALTER - alters the structure of the database 3. DROP - delete objects from the database 4. TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed 5. COMMENT - add comments to the data dictionary 6. RENAME - rename an object
Try to Remember DDL as CAD (AutoCAD, designing software) for Create, Alter and Drop.
Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:
1. SELECT - retrieve data from the a database 2. INSERT - insert data into a table 3. UPDATE - updates existing data within a table 4. DELETE - deletes all records from a table, the space for the records remain 5. MERGE - UPSERT operation (insert or update) 6. CALL - call a PL/SQL or Java subprogram 7. EXPLAIN PLAN - explain access path to data 8. LOCK TABLE - control concurrency
Try to remember DML as SIU or SUI (switzerland ->Roger Federer) for Select, Update and Insert
