作業:
`eid` int primary key auto_increment comment'員工編號',
`ename` varchar(20) comment '員工姓名',
`e***` char(2) comment '性別',
`ebirthday` datetime comment '生日',
`eaddress` varchar(50) default '位址不詳' comment '位址',
`edate` datetime comment '入職時間'
)engine=innodb default charset=utf8;
create table if not exists escore(
`sid` int primary key auto_increment comment '銷售編號',
`eid` int ,
`sdate` datetime comment '銷售日期',
`smoney` decimal(18,2) comment '銷售金額',
`sdiscount` decimal(18,1) comment '提成比例'
)engine=innodb default charset=utf8;
insert into employeeinfo(`ename`,`e***`,`ebirthday`,`eaddress`,`edate`)
value('張無忌','男','1983-11-15','河北嵩山','2009-10-6'),
('左冷禪','男','1990-3-2','河北崑崙山','2009-7-1'),
('段延慶','男','1990-9-28','雲南大理','2012-9-12'),
('孔仲尼','男','1980-4-4','山東曲阜','2003-1-1'),
('李莫愁','女','1992-8-2','燕大小吃街','2011-10-16'),
('王語嫣','女','1998-12-1','燕子塢','2014-1-2');
insert into escore(`eid`,`sdate`,`smoney`,`sdiscount`)
value(1,'2013-11-12','64532','0.1'),
(2,'2013-11-11','46211','0.1'),
(2,'2014-1-15','7000','0.2'),
(3,'2015-3-1','83231','0.2'),
(1,'2014-12-11','8742','0.2'),
(3,'2011-10-19','23224','0.1'),
(5,'2014-4-4','50000','0.1'),
(5,'2011-11-11','90000','0.1'),
(6,'2015-2-28','30000','0.2'),
(4,'2012-12-12','99999','0.1'),
(4,'2015-1-14','84230','0.2');
# 修改 左冷禪的位址為 河北太行山
update employeeinfo set eaddress='河北太行山' where ename='左冷禪';
# 修改李莫愁的位址為燕大雲龍小吃城 生日為 1984-10-17
update employeeinfo set eaddress='燕大雲龍小吃城',ebirthday='1984-10-17' where ename='李莫愁';
# 查詢全部員工資訊
select * from employeeinfo;
# 查詢所有男員工的姓名、位址、生日並顯示中文列名
select ename as '姓名',eaddress as '位址',ebirthday as '生日' from employeeinfo where e***='男';
# 查詢位址中包含山的員工資訊
select * from employeeinfo where eaddress like '%山%';
# 查詢位址中包含燕的女員工資訊
select * from employeeinfo where eaddress like '%燕%' and e***='女';
# 查詢員工的姓名、位址、生日、公司名稱(常量列『大軟公司』)
select ename,eaddress,ebirthday,'大軟公司' as '公司名稱' from employeeinfo;
# 刪除孔子這名員工
delete from employeeinfo where ename='孔仲尼';
# 查詢入職時間在2011到2023年之間的員工資訊
select * from employeeinfo where `edate` between '2011-1-1' and '2013-12-31';
# 查詢有銷售業績的員工資訊(in 子查詢)
select * from employeeinfo where eid in(select eid from escore where eid!=0);
# 查詢員工姓名、位址、銷售日期、銷售金額(表連線)
select ename,eaddress,sdate,smoney from employeeinfo,escore where employeeinfo.eid=escore.eid;
-- 查詢員工業績表 顯示 員工編號、銷售日期、銷售金額、提成比例、提成金額並顯示為中文列名
select
eid '員工編號',
sdate '銷售日期',
smoney '銷售金額',
sdiscount '提成比例',
smoney *sdiscount '提成金額'
from
escore;
```資料表最終結果:
日常作業2017 7 19
小白一枚。題目如下 有兩個執行緒,乙個是存錢的,乙個是取錢的,實現乙個無限的存錢和無限的取錢功能,每次存錢存100塊,每次取錢取100塊,如果取出錢的金額大於賬戶餘額 則列印賬戶餘額不足,每次存完錢要休息500毫秒,每次取完錢休息1秒,要求每次執行完乙個訪問錢的過程,需要列印如下資訊 年 月 日 存...
日常作業2
1 顯示當前時間,格式為hh mm ss,並儲存到檔案time.txt檔案中 root localhost desktop date t tee time.txt21 37 23 root localhost desktop cat time.txt21 37 23 2 顯示 etc passwd檔...
日常作業2019 1 15
作業 實現簡易計算機,分別實現兩個整數 三個浮點數的加法運算 package com.job1 15 計算器 author administrator 2019.1.15 public class calculator 三個浮點數相加 param num1 param num2 param num3...