SQL语句代码
create database chapter03;
use chapter03;
CREATE table employees(
EmployeeID char(9),
Name VARCHAR(50),
Gender enum('男','女'),
Age int UNSIGNED,
JobPosition ENUM('业务经理','开发人员','顾问'),
Salary decimal(10,2),
JoinedAt datetime,
Address TEXT
);
show create table employees;
drop table employees;
desc employees;
insert into employees values(
'EMP-00001',
'张丹',
'男',
32,
'业务经理',
16000,
'2016-09-23 10:00:00',
'南京市'
);
insert into employees(EmployeeID,Name,Gender,Age,JobPosition,Salary,JoinedAt)
values(
'EMP-00002',
'季冉糯',
'女',
28,
'顾问',
9000,
'2017-03-16 08:00:00'
);
insert into employees values
( 'EMP-00003','王嘉','男',35,'开发人员',14000,'2018-11-12 14:00:00','北京市'),
( 'EMP-00004','谭明','男',26,'开发人员',11000,'2018-11-12 14:00:00','上海市'),
( 'EMP-00005','唐潇','女',27,'开发人员',13000,'2018-11-12 14:00:00','武汉市'),
( 'EMP-00006','武鸣','男',25,'开发人员',9000,'2018-11-12 14:00:00','济南市');
insert into employees(EmployeeID,Name,Gender,Age,JobPosition,Salary,JoinedAt)
values
('EMP-00007','赵佳怡','女',23,'顾问',12000,'2017-03-16 08:00:00'),
('EMP-00008','乌海','女',38,'业务经理',19000,'2017-03-16 08:00:00'),
('EMP-00009','章节节','男',28,'开发人员',11000,'2017-03-16 08:00:00'),
('EMP-00010','孔慧语','女',29,'顾问',17000,'2017-03-16 08:00:00');
use chapter03;
create table employees01(
EmployeID CHAR(10) NOT NULL,
Name VARCHAR(50) NOT NULL,
Gender enum('男','女'),
Age int unsigned,
JobPosition enum('业务经理','业务顾问','开发人员','UI设计') NOT NULL,
JoinedAt datetime,
salary decimal(10,2),
Address text
);
INSERT into employees01 VALUES
('EMP-00001','孔慧语','女',29,'业务顾问','2017-03-16 08:00:00',17000,'xxxx');
insert into employees01(EmployeID,name,jobposition) values
('EMP-00004','AQW','UI设计'),
('EMP-00005','wAS','业务顾问');
drop table employees01;
CREATE table employee01(
empID char(10) not null,
name varchar(40) not null,
gender enum('男','女'),
age int unsigned,
jobposition enum('业务经理','业务顾问','开发人员','UI设计') not null,
JoinedAt datetime DEFAULT '2023-05-28 00:00:00',
salary decimal(10,2) DEFAULT 9000,
Address text
);
insert into employee01(empID,name,jobposition) values
('EMP-00001','顾语雨','业务顾问'),
('EMP-00002','雷无桀','业务顾问'),
('EMP-00003','萧瑟','开发人员');
drop table employ02;
use chapter03;
create table employ02(
empID INT NOT NULL unique,
name varchar(30) not null ,
gender enum('男','女'),
jobposition enum('业务经理','业务顾问','开发人员','UI设计') not null,
JoinedAt datetime DEFAULT '2023-05-28 00:00:00',
salary decimal(10,2) DEFAULT 9000,
Address text
);
insert into employ02(empID,name,jobposition) values
(01,'顾语雨','业务顾问'),
(02,'雷无桀','业务顾问'),
(03,'萧瑟','开发人员');
insert into employ02(empID,name,jobposition) values
(04,'顾语雨','业务顾问'),
(05,'雷无桀','业务顾问');
drop table employ02;
use chapter03;
create table employ02(
empID INT unique auto_increment,
name varchar(30) not null ,
gender enum('男','女'),
jobposition enum('业务经理','业务顾问','开发人员','UI设计') not null,
JoinedAt datetime DEFAULT '2023-05-28 00:00:00',
salary decimal(10,2) DEFAULT 9000,
Address text
);
insert into employ02(name,jobposition) values
('顾语雨','业务顾问'),
('雷无桀','业务顾问'),
('萧瑟','开发人员');
insert into employ02(name,jobposition) values
('顾大大','业务顾问'),
('雷大大','业务顾问');