Today in the group discussion, DDL or DML, I this small white or summed up their differences.
1. Ddl–data Definition Language
Database Definition language: Defines the structure of the database.
The main orders are Create,alter,drop, and so on, the following examples are detailed. This language does not require a commit, so be cautious.
Create–to create objects in the database creating objects
Example: CREATE DATABASE test; To create a database named Test
Alter–alters the structure of the database structure
Example: ALTER TABLE test ADD birthday date; Modify test table to add Birthday column of date type
Drop–delete objects from the database to delete objects from databases
Example: Drop database test;//Delete test databases
There are other:
truncate– TRUNCATE TABLE content (development period, still quite common)
comment– adding notes to a data dictionary
2. Dml–data Manipulation Language
Database manipulation Language: processing data in a database in SQL
Its main orders have Select,insert,update,delete, and so on, these examples are often not introduced. The language requires a commit. There are also commonly used lock TABLE, remember to write a locked blog – portal
There are other unfamiliar:
call– call a PL/SQL or Java subroutine
EXPLAIN plan– Parse Data access path
3. Dcl–data Control Language
Database Control Language: Authorization, role control, etc.
grant– granting access to users
revoke– Revoke authorization rights
4. Tcl–transaction Control Language
Transaction Control Language
commit– saving the work that has been done
savepoint– setting a savepoint in a transaction can be rolled back here
rollback– rollback
SET transaction– Change transaction options
Database must be known in SQL four languages: DDL DML DCL TCL (EXT)