--SQL212321QueryAnalyzer22QueryAnalyzer2016-5-12016-5-282016-5-12016-5-282016-5-12016-5-282016-5-12016-5-28--2016-5-12016-5-282016-5-12016-5-282016-5-12016-5-282016-5-12016-5-282016-5-12016-5-282000()union3QueryAnalyzer(3)--SQLSQL--SQL312321QueryAnalyzer3.22QueryAnalyzer62--insertintovalues('zy2016001','wm004',100,10)insertintovalues('zy2016002',NULL,200,10)6y007112203002insertintovalues('zy2016007','wm006',100,10)zy2016001112202002wm004wm046--3QueryAnalyzer2('zy2016008','112202002','y005',10000,'','2016-07-02')SQLSQL--123421QueryAnalyzerinsertintovalues('zy2016006','112202002','y005',10000,'','07-01-2016','07-04-2016','07-25-2016','','',7000,2500,1000,1400,11900,'','07-26-2016',11900,'','07-28-2016')insertintovalues('zy2016006','wm001',200,10)insertintovalues('zy2016006','wm002',200,10)insertintovalues('zy2016006','wm003',200,10)insertintovalues('zy2016006','wm004',100,10)--2QueryAnalyzer3QueryAnalyzer()*****---******.******.******.******.******.**=-=-4QueryAnalyzer--=+++3SQLSQL--2QueryAnalyzeruser11user11user12user12user12user12--3-----------------------------------------------------------------CREATETABLE(CHAR(20),CHAR(20));CREATETABLE(CHAR(20),CHAR(20),CHAR(20));--CREATETABLE(CHAR(20));CREATETABLE(CHAR(20),CHAR(20),CHAR(20));createtable(CHAR(20),CHAR(20),INT,MONEY,);CREATETABLE(CHAR(20),CHAR(20),CHAR(20),MONEY,CHAR(20),DATETIME,--DATETIME,DATETIME,CHAR(20),CHAR(20),money,MONEY,MONEY,money,MONEY,CHAR(20),DATETIME,MONEY,CHAR(10),DATETIME)-------------------------------------------------------------------------------insertintovalues('1122','');insertinto--values('112201','');insertintovalues('112202','');insertintovalues('112201001','');insertintovalues('112201002','');insertintovalues('112201003','');insertintovalues('112202001','');insertintovalues('y001','','112201001');insertinto--values('y002','','112201001');insertintovalues('y003','','112201002');insertintovalues('s001','','112201002');insertintovalues('y004','','112201003');insertintovalues('s002','','112202001');insertintovalues('s003','','112202001');insertintovalues('y005','','112202002');insertintovalues('');--insertintovalues('');insertintovalues('');insertintovalues('wm001','','');insertintovalues('wm002','','');insertintovalues('wm003','','');insertintovalues('wm004','','');insertinto(,,,)values('zy2016001','wm001',200,10);--insertinto(,,,)values('zy2016001','wm002',200,10);insertinto(,,,)values('zy2016001','wm003',200,10);----------------------------------------------------------------insertinto(,,,)values('zy2016003','wm001',200,10);insertinto(,,,)values('zy2016003','wm002',200,10);insertinto(,,,)values('zy2016003','wm003',250,10);--------------------------------------------------------------------insertinto(,,,)values('zy2016004','wm001',200,10);insertinto(,,,)values('zy2016004','wm002',200,10);--insertinto(,,,)values('zy2016004','wm004',200,10);------------------------------------------------------insertinto(,,,)values('zy2016005','wm001',200,10);insertinto(,,,)values('zy2016005','wm002',200,10);insertinto(,,,)values('zy2016005','wm004',300,10);--------------------------------------------------------------------insertintovalues('zy2016001','112201001','y001',10000,'','2016/5/1','2016/5/4','2016/5/23','','',7000,2500,1000,1400,10900,'','2016/5/26',10900,'','2016/5/28');----------------------------------------------------------insertintovalues('zy2016003','112201002','s001',10500,'','2016/5/1',--'2016/5/6','2016/5/23','','',6500,2000,500,1400,10400,'','2016/5/26',10400,'','2016/5/28');---------------------------------------------insertintovalues('zy2016004','112202001','s002',12000,'','2016/5/1','2016/5/4','2016/5/24','','',6000,2000,1000,1600,10600,'','2016/5/26',10600,'','2016/5/28');--------------------------------------------insertintovalues('zy2016005','112202002','y005',12000,'','2016/5/1','2016/5/4','2016/5/28','','',7000,1000,2000,1300,11300,'','2016/6/1',NULL,NULL,NULL);---------------------------------------begintranupdateset=+200where='zy2016005';--updateset=+200where='zy2016005';deletefromwhereisNULL;rollbacktran---------------------------------------------------1createindexon();createindexon();createindexon();--(1)select*fromwherebetween'2016/5/1'and'2016/5/28'and=(selectfromwhere='');--anothersolution--select*from,where=and=''andbetween'2016/5/1'and'2016/5/28';--(2)select*fromwherebetween'2016/5/1'and'2016/5/28'and=(selectfromwhere='');--anothersolution--select*--from,--where=''and=and='2016-5-1'and='2016-5-28';--(3)-----------------------------------------------select*fromwhere=(select--fromwherebetween'2016/5/1'and'2016/5/28'and=(selectfromwhere=''));--(4)------------------------------------------select*fromwherebetween'2016/5/1'and'2016/5/28'and=(selectfromwhere='');--(5)-----------------------------------------select,sum()fromwherebetween'2016/5/1'and'2016/5/28'and=(selectfromwhere='');--(6)--------------------------------select,sum()from--wherebetween'2016/5/1'and'2016/5/28'and=(selectfromwhere='');--(7)---------------