Home > database >  The four broad categories of SQL is a bit confuse!
The four broad categories of SQL is a bit confuse!

Time:10-11

Is learning to MySQL, classification is a little bit confused about SQL, some, divided into DCL, DML, DDL and TCL four categories, some, divided into DCL, DML,
DDL and DQL four categories, this let me lost, what will be one of TCL and DQL which fall into four categories, or I don't fully understand what is classification?
Passing the bosses have a understand!

CodePudding user response:

I understand it should be 5 major categories, engines, classification may have difference, some engines have no transaction would be no need for TCL, some engines made special for query optimization, take out your query alone,
DQL query (data)
Search for the value of the field in the database (table)
Select - query field

DML (data manipulation language)
The database data for related operation
Delete - delete records
Update - change record
Insert, insert record

DDL definition language (statements)
Define or change the structure of a table, the data type (on the table, not involving the record changes)
The CREATE - CREATE a table
ALTER, modify the fields in the table
DROP - delete table
TRUNCATE - delete records in the table, don't change structure

DCL (data control language)
Set or change the database user or a role permissions
GRANT authorized
-REVOKE - back has been granted permission to

TCL (transaction control language)
COMMIT - submit
The ROLLBACK - ROLLBACK
The SAVEPOINT - setting, save can roll back to here
  • Related