Home > database >  Figure 1 mysql by what kind of a query can be obtained from three tables figure 2
Figure 1 mysql by what kind of a query can be obtained from three tables figure 2

Time:10-03

CodePudding user response:

Select a. *, b.s core as EnglishScore, c.s. core as MathScore from student a
Left the join EnglishScore b on Anderson, d=b.s tnum
Left the join MathScore on c.s. tnum Anderson, d=c

CodePudding user response:

 SELECT students. *, 
EnglishScore. Score AS EnglishSroce,
MathScore. Score AS MathScore
The FROM students
The JOIN EnglishScore ON EnglishScore. Stnum=students. Id
The JOIN MathScore ON MathScore. Stnum=students. Id
WHERE students. Id=15001

CodePudding user response:

 select b.s tnum, a.n ame, b.s ocre as englishscore, c.s. core as mathscore 
The from student a left join Englishscore b on Anderson, d=b.s tnum - through student table id with Englishscore table stnum connection of each of the students come to the English
Left the join mathsocre on c.s. tnum - Anderson, d=c through student table id with mathscore table stnum connections that each student's mathematics result
Where Anderson, d=1

Look at the join syntax will see
http://www.w3school.com.cn/sql/sql_join.asp

CodePudding user response:

Junction post rate: 0%

When you the solutions of the problems please post.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html

8, how to give points and knot stick?
http://bbs.csdn.net/help#post_dispose

CodePudding user response:

The select EnglishScore strNum, students name, EnglishScore. Score as EnglishScore, MathScore. Score as MathScore
From students, EnglishScore MathScore
Where students. Id=15001 and MathScore. Strnum=15001 and English. Strnum=15001
  • Related