创建表offices、employees
CREATE TABLE employees(
employeeNumber INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
lastName VARCHAR(50) NOT NULL,
firstName VARCHAR(50) NOT NULL,
mobile VARCHAR(25) UNIQUE,
officeCode INT(10) NOT NULL,
jobTitle VARCHAR(50) NOT NULL,
birth datetime NOT NULL,
note VARCHAR(255),
sex VARCHAR(5),
FOREIGN KEY (officeCode) REFERENCES offices(officeCode)
);
查看
将表employees的mobile字段修改到officeCode字段后面
将表employees的birth字段改名为employee_birth
修改sex字段,数据类型为CHAR(1),非空约束
删除字段note
增加字段名favoriate_activity,数据类型为VARCHAR(100)