數據庫簡單學習與應用

 員工信息表[員工號,姓名,性別],T_Worker[WorkerId,name,sex]
員工遲到表[員工號,遲到日期,遲到時長],T_Late[WorkerId,latetime,latelong]
1.在 日期1 (2008-4-2) 到日期2 (2008-4-4) 之間遲到的員工姓名
2.查詢員工姓名含有O的員工信息
3.更改員工號爲00001的員工的姓名爲Jack
4.遲到兩次以上的員工號
5.沒有遲到的員工信息(用Join)
6.編寫觸發器,當刪除員工信息時,同時刪除對應的遲到記錄 date

--select T_Worker.name from T_Worker where T_Worker.WorkerId in(select T_Late.WorkerId from T_Late where T_Late.latetime between '2008-4-2' and '2008-4-4')
--select * from T_Worker where name like '%林%';
--update T_Worker  set name = 'Jack' where WorkerId = '0001';
--select WorkerId from T_Late  group by WorkerId   having count(*)>=2;
--select T_Late.WorkerId,T_Worker.name,T_Worker.sex,T_Late.latetime,T_Late.latelong from T_Worker inner join  T_Late  on  T_Worker.WorkerId = T_Late.WorkerId and T_Late.latetime is NULL  order by T_Worker.WorkerId;select