Common sql statement --DDL

Notes at:

Notes * /

# Single-line comments (MYSQL)

- Single-line comments (Note: two spaces in each horizontal line must be added)

 

 

DDL (Data Definition Language) -create (create), alter (change), drop (delete)

create database database name

 

Example:

 

Create and delete databases

 

 

Create Table Syntax:
Create table Table (
Field Name Type (length) [is empty] [Degree Default] [Are zero padding] [Are unsigned] [Settings constraint] ...,
Field Name Type (length ) [is empty] [Degree default] [Are zero padding] [Are unsigned] [settings constraint] ...,
)

Example:

 

 

DROP TABLE ta1, ta2;
delete tables
TRUNCATE TABLE te;
delete table data (designated disposable delete all the data of a table, and not logs, note: not delete the log)

 

 

Guess you like

Origin www.cnblogs.com/zhuyunlong/p/11870920.html