创建一个数据库和两张表
数据库:company
数据表:offices和employees
create schema company;use company;create table offices (officeCode int(10) primary key not null unique,city varchar(50) not null,address varchar(50),county varchar(50) not null,pastalCode varchar(15) unique);create table employees (employeeNumber int(11) primary key not null unique auto_increment,lastName varchar(50) not null,fisrtName 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),constraint fk_off_emp foreign key(officeCode) references offices(officeCode));alter table employees modify mobile varchar(25) after officeCode;alter table employees change birth employee_birth datetime;alter table employees change sex sex varchar(1) not null;alter table employees modify sex char(1) not null;alter table employees drop note;alter table employees add favoriate_activity varchar(100);drop table offices;alter table employees drop foreign key fk_off_emp;drop table offices;alter table employees engine=myisam;show create table employees\G;alter table employees rename employees_info;