数据库中制作测试数据用到的左右连接和内连接
1.
select * from StudentTagId inner join Student on StudentTagId.StudentId=Student.Stud_ID
这个才能更方便我来查看我需要的数据
select StudentTagId.StudentId,StudentTagId.TagId,StudentTagId.StartDate,StudentTagId.EndDate,Student.Last_Name,Student.First_Name from StudentTagId inner join Student on StudentTagId.StudentId=Student.Stud_ID
INSERT INTO StudentTagId
(DBID, StudentId,TagId, StartDate)
VALUES
(7, 3673,2020111901,2020-11-20),
(7, 3675,2020111901,2020-11-18),
(7, 3676,2020111901,2020-11-21),
(7, 3678,2020111901,2020-11-19),
(7, 3680,2020111901,2020-11-20),
(7, 3684,2020111901,2020-11-19),
(7, 3687,2020111901,2020-11-21),
(7, 3690,2020111901,2020-11-22),
(7, 3693,2020111901,2020-11-11),
(7, 3696,2020111901,2020-11-11)
批量改数据
update StudentTagId set EndDate='2020-11-11' where ID> 19 and ID<= 25