1. 创建数据库
CREATE DATABASE test1;
2. 删除数据库
DROP DATABASE test1;
3. 创建表
CREATE TABLE tabname (userid BIGINT(11) NOT NULL PRIMARY KEY ,username VARCHAR(20),userpwd VARCHAR(20),employee_id VARCHAR(20),employee_name VARCHAR(20),address VARCHAR(20));
创建已有表相似表
CREATE TABLE tabname2 AS SELECT userid,username,userpwd,address FROM tabname ;
4. 删除表
DROP TABLE tabname2;
5. 增加一列
ALTER TABLE tabname ADD tel INT(11);
6. 修改一列
ALTER TABLE tabname MODIFY tel VARCHAR(11);
7. 几个简单的sql语句
插入数据:INSERT INTO tabname (userid,username,userpwd,employee_id,employee_name,address,tel) VALUES ('001','xl','password@1','1406081112','tester','上海浦东新区张东路1388号10号楼','13612345678');