创建新数据库:CREATE DATABASE database_name; 删除数据库:DROP DATABASE database_name; 修改表:增加字段:mysql> ALTER TABLE table_name ADD field_name field_type; 查看表:mysql> SELECT * FROM table_name; 修改原字段名称及类型:mysql> ALTER TABLE table_name CHANGE old_field_name new_field_name field_type; 删除字段:ALTER TABLE table_name DROP field_name; 修改更新记录:mysql> UPDATE table_name SET field_name="values" WHERE select_field_name="values"; 添加新记录: mysql> INSERT INTO table_name valueS ("values1","values2",……,"valuesN"); 删除记录: mysql> DELETE FROM table_name WHERE select_field_name="values";
显示记录:
显示所有字段:mysql> SELECT * FROM table_name; 显示特定字段:mysql> SELECT values1,values2,……valuesN FROM table_name; 显示特定条件的记录(所有字段):mysql> SELECT * FROM table_name WHERE select_field_name="values"; 显示特定条件的记录(指定字段):mysql> SELECT values1,values2,……valuesN FROM table_name WHERE select_field_name="values";