MySQL命令:
SHOW DATABASES; 显示数据表
CREATE DATABASE game; 创建数据表
DROP DATABASE game; 删除数据表
use game; 使用数据表“game”
CREATE TABLE player ( 增加表“player”
id INT,
name VARCHAR(100),
level INT,
exp INT,
gold DECIMAL(10,2)
)
ALTER TABLE player RENAME COLUMN name to myname; 修改字段名称
ALTER TABLE player MODIFY COLUMN name VARCHAR(200); 修改字段默认值
ALTER TABLE player ADD COLUMN maxspeed float; 添加字段
ALTER TABLE player DROP COLUMN maxspeed; 删除字段
DESC player; 查看数据表结构
DROP TABLE player; 删除表