当前位置:Gxlcms > 数据库问题 > mysql_2

mysql_2

时间:2021-07-01 10:21:17 帮助过:5人阅读

创建表 create [temporary] table [if not exists] tbl_name [( [column_definition],...|[index_definition])] [table_option] [select_statement]; column_definition: col_name type [not null | null] [default default_value] [auto_increment]--设置自增属性,只有整型列才能设置此属性。当插入NULL值或0到一个AUTO_INCREMENT列中时,列被设置为value+1, --在这里value是此前表中该列的最大值。AUTO_INCREMENT顺序从1开始。每个表只能有一个AUTO_INCREMENT列,并且它必须被索引。 [unique [key]| [primary] key] [comment ‘string‘] [reference_definition] reference_definition: references tbl_name [(index_col_name,...)] [on delete {restrict | cascade | set null | no action}] [on update {restrict | cascade | set null | no action}] index_definition: [constraint [symbol]]primary key [index_type] (index_col_name,...) /*主键*/ |{index | key} [index_name] [index_type] (index_col_name,...) /*索引*/ |[constraint [symbol]] unique [index] [index_name] [index_type] (index_col_name,...)/*唯一性索引*/ |[fulltext|spatial] [index] [index_name] (index_col_name,...) /*全文索引*/ |[constraint [symbol]] foreign key [index_name] (index_col_name,...) [reference_definition]/*外键*/ }] table_option: {engine | type} = engine_name /*存储引擎*/ | auto_increment = value /*初始值*/ | avg_row_length = value /*表的平均行长度*/ | [default] character set charset_name [collate collation_name] /*默认字符集和校对*/ | checksum = {0 | 1} /*设置为1表示求校验和*/ | comment = string /*注释*/ | connection = connect_string /*连接字符串*/ | max_rows = value /*行的最大数*/ | min_rows = value /*列的最小数*/ | pack_keys = {0 | 1 | default} | password = string /*对.frm文件加密*/ | delay_key_write = {0 | 1} /*对关键字的更新*/ | row_format = {default|dynamic|fixed|compressed|redundant|compact}/*定义各行应如何储存*/ | union = (tbl_name[,tbl_name]...) /*表示哪个表应该合并*/ | insert_method = { no | first | last } /*是否执行insert语句*/ | data directory = absolute path to directory /*数据文件的路径*/ | index directory = absolute path to directory /*索引的路径*/ select_statement:

 

mysql_2

标签:update   row   res   外键   pack   exists   not   fulltext   const   

人气教程排行