1.规划
2.需求分析
3.概念模型设计
4.逻辑设计
5.物理设计
6.程序编制及调试
7.运行及维护。
CREATE DATEBASE database_name
SHOW DATABASE
USE database_name
DORP DATABASE database_name
SHOW ENGINES;
SHOW VARIABLES LIKE ‘storage_engine%’
CRATE TABLE table_name(
Field_name data_type,
Field_name data_type,
…
Field_name data_type
)
DESC[RIBE] table_name
DROP TABLE table_name
ALTER TABLE old_table_name RENAME [TO] new_table_name
ALTER TABLE table_name ADD field_name data_type
SHOW CREATE TABLE table_name
ALTER TABLE table_name ADD field_name data_type FIRST
ALTER TABLE table_name ADD field_name data_type AFTER field_name
ALTER TABLE table_name DORP field_name
ALTER TABLE table_name MODIFY field_name data_type
ALTER TABLE table_name CHANGE old_field_name new_field_name old_data_type
ALTER TABLE table_name CHANGE old_field_name new_field_name new_data_type
ALTER TABLE table_name MODIFY field_name_1 data_type [FIRST]|[AFTER field_name_2]
Field_name data_type NOT NULL
Field_name data_type DEFAULT default_value
1、Field_name data_type UNIQUE
2、CONSTRAINT constraint_name UNIQUE(field_name)
Field_name data_type PRIMARY KEY
CONSTRAINT constraint_name PRIMARY KEY (field_name_1, field_name_2, …)
Field_name data_type AUTO_INCREMENT
CONSTRAINT constraint_name FOREIGN KEY(filed_name)
REFERENCES other_table_name(other_field_name)
[表示可先项]
|表示选择
table_name(
column_name
INDEX|KEY [index_name](field_name [(index_length)] [ASC|DESC])
)
1、CREATE INDEX index_name ON table_name (
field_name [(index_length)] [ASC|DESC])
2、ALTER TABLE table_name ADD INDEX|KEY
index_name(field_name [(index_length)] [ASC|DESC])
table_name(
column_name
UNIQUE INDEX|KEY [index_name](
field_name [(index_length)] [ASC|DESC])
)