数据库操作,建表salary,departments,employees



CREATE TABLE departments (
  departmentid char(3) NOT NULL,
  departmentname char(20) NOT NULL,
  note text,
  PRIMARY KEY (departmentid)
) ENGINE=InnoDB;

DROP table departments




create table employees (
  employeeId char(6) NOT NULL,
  name char(10) NOT NULL,
  enducation char(4) NOT NULL,
  britday date NOT NULL,
  sex char(2) NOT NULL,
  workyear tinyint(1) DEFAULT NULL,
  address varchar(20) DEFAULT NULL,
  phonenumber char(11) DEFAULT NULL,
  departmentid char(3) DEFAULT NULL,
  PRIMARY KEY (departmentid)
) ENGINE=InnoDB;

DROP table employees

create table salary
(

employeeid char(6) not null primary key,

income FLOAT(8) not null,
outcome FLOAT(8) not null
);


INSERT INTO employees VALUES ('000001', '王林', '大专', '1966-01-23', '1', 8, '中山路32-1-508', '83355668', '2');

INSERT INTO employees VALUES ('010008', '伍容华', '本科', '1976-03-28', '1', 3, '北京东路100-2', '83321321', '1');

INSERT INTO employees VALUES ('020010', '王向荣', '硕士', '1982-12-09', '1', 2, '四牌楼', '83792361', '1');

INSERT INTO employees VALUES ('020018', '李丽', '大专', '1960-07-30', '0', 6, '中山东路102-2', '83413301', '1');

INSERT INTO employees VALUES ('102201', '刘明', '本科', '1972-10-18', '1', 3, '虎距路100-2', '83606608', '5');

INSERT INTO employees VALUES ('102208', '朱俊', '硕士', '1965-09-28', '1', 2, '牌楼巷5-3-106', '84708817', '5');

INSERT INTO employees VALUES ('108991', '钟敏', '硕士', '1979-08-10', '0', 4, '中山路10-3-105', '83346722', '3');

INSERT INTO employees VALUES ('111006', '张石兵', '本科', '1974-10-01', '1', 1, '解放路34-1-203', '84563418', '5');

INSERT INTO employees VALUES ('210678', '林涛', '大专', '1977-04-02', '1', 2, '中山北路24-35', '83467336', '3');

INSERT INTO employees VALUES ('302566', '李玉珉', '本科', '1968-09-20', '1', 3, '热和路209-3', '58765992', '4');

INSERT INTO employees VALUES ('308759', '叶凡', '本科', '1978-11-18', '1', 2, '北京西路3-7-52', '83308901', '4');

INSERT INTO employees VALUES ('504209', '陈林琳', '大专', '1969-09-03', '0', 5, '汉中路120-4-12', '84468158', '4');

INSERT INTO salary VALUES ('000001', 2100.80, 123.09);
INSERT INTO salary VALUES ('010008', 1582.62, 88.03);
INSERT INTO salary VALUES ('020010', 2860.00, 198.00);
INSERT INTO salary VALUES ('020018', 2347.68, 180.00);
INSERT INTO salary VALUES ('102201', 2569.88, 185.65);
INSERT INTO salary VALUES ('102208', 1980.00, 100.00);
INSERT INTO salary VALUES ('108991', 3259.98, 281.52);
INSERT INTO salary VALUES ('111006', 1987.01, 79.58);
INSERT INTO salary VALUES ('210678', 2240.00, 121.00);
INSERT INTO salary VALUES ('302566', 2980.70, 210.20);
INSERT INTO salary VALUES ('308759', 2531.98, 199.08);
INSERT INTO salary VALUES ('504209', 2066.15, 108.00);


INSERT INTO departments VALUES ('1', '财务部', NULL);
INSERT INTO departments VALUES ('2', '人力资源部', NULL);
INSERT INTO departments VALUES ('3', '经理办公室', NULL);
INSERT INTO departments VALUES ('4', '研发部', NULL);
INSERT INTO departments VALUES ('5', '市场部', NULL);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值