Table structure
--Student Table tblstudent (number stuid, name Stuname, age stuage, gender stusex)
--Curriculum Tblcourse (Course number CourseID, course name Coursename, teacher number Teaid)
--Score Table Tblscore (student number Stuid, course number CourseID, score score)
--Teacher's table Tblteacher (teacher number Teaid, name Teaname)
CREATE TABLEtblstudent (StuidINT, Stunamenvarchar( +), StuageINT, Stusexnvarchar(8) ) CREATE TABLETblcourse (CourseIDINT, Coursenamenvarchar( +), TeaidINT ) CREATE TABLETblscore (StuidINT, CourseIDINT, scoreINT ) CREATE TABLETblteacher (TeaidINT, Teanamenvarchar( -) ) Insert intoTblstudentSelect 1N'Liu', -N'male' Union All Select 2N'Money Two', +N'female' Union All Select 3N'Zhang San', -N'male' Union All Select 4N'John Doe', -N'female' Union All Select 5N'Harry', -N'male' Union All Select 6N'Zhao Liu', +N'female' Insert intoTblteacherSelect 1N'cotyledons' Union All Select 2N'He Gao' Union All Select 3N'Linda' Union All Select 4N'Zhoulei' Insert intoTblcourseSelect 1N'language',1 Union All Select 2N'Mathematics',2 Union All Select 3N'English',3 Union All Select 4N'Physical',4 Insert intoTblscoreSelect 1,1, About Union All Select 1,2, + Union All Select 1,3, the Union All Select 1,4, - Union All Select 2,1, - Union All Select 2,2,Bayi Union All Select 2,3, the Union All Select 2,4, the Union All Select 3,1, the Union All Select 3,2, - Union All Select 3,3, the Union All Select 3,4, About Union All Select 4,2, the Union All Select 4,3, - Union All Select 4,4, the Union All Select 5,1, $ Union All Select 5,3, + Union All Select 5,4, - Union All Select 6,1, * Union All Select 6,2, the Union All Select 6,4, in
View Code
53928474
SQL Server Foundation Student table-Teachers table-timetable-selected timetable (ii)