1.创建表dept1
CREATE TABLE dept1(
id INT(7),
NAME VARCHAR(25)
);
2.将表departments中的数据插入新表dept2中
CREATE TABLE dept2
SELECT*
FROM departments
3.创建表emp5
CREATE TABLE emp5(
id INT(7),
First_name VARCHAR(25),
Last_name VARCHAR(25),
Dept_id INT(7)
);
4.将列Last_name的长度增加到50
ALTER TABLE emp5
MODIFY COLUMN Last_name VARCHAR(50);
5.根据表employees创建employees2
CREATE TABLE employees2
LIKE employees;
6.删除表emp5
DROP