Mysql:SQL语句:DDL语句

RENAME TABLE tbl_name TO new_tbl_name [, tbl_name2 TO new_tbl_name2] ...

 

 

 

ALTER {DATABASE | SCHEMA} [db_name] {[DEFAULT] CHARACTER SET [=] charset_name | [DEFAULT] COLLATE [=] collation_name}

 

 

CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name

[ [DEFAULT] CHARACTER SET [=] charset_name | [DEFAULT] COLLATE [=] collation_name ]

CREATE

[TEMPORARY]

TABLE [IF NOT EXISTS] tbl_name

  1. (create_definition,...) [table_options] [partition_options]
  2.  [(create_definition,...)] [table_options] [partition_options] select_statement
  3.  { LIKE old_tbl_name | (LIKE old_tbl_name) }

 

 

CREATE [OR REPLACE]

[ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}] [DEFINER = { user | CURRENT_USER }] [SQL SECURITY { DEFINER | INVOKER }]

VIEW view_name [(column_list)]

AS select_statement

[WITH [CASCADED | LOCAL] CHECK OPTION]

 

 

CREATE

[ONLINE|OFFLINE] [UNIQUE|FULLTEXT|SPATIAL]

INDEX index_name

[index_type]

ON tbl_name (index_col_name,...)

[index_option]

 

 

CREATE

[DEFINER = { user | CURRENT_USER }]

PROCEDURE sp_name ([proc_parameter[,...]])

[characteristic ...]

routine_body

 

 

 

CREATE

[DEFINER = { user | CURRENT_USER }]

FUNCTION sp_name ([func_parameter[,...]])

RETURNS type

[characteristic ...]

routine_body

 

 

 

CREATE

[DEFINER = { user | CURRENT_USER }]

TRIGGER trigger_name

trigger_time

trigger_event

ON tbl_name

FOR EACH ROW

trigger_stmt

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(mysql)