DQL数据查询语句基础(2)

1 select t.sno,s.sname,t.degree,c.cname from SCORE t,STUDENT s,COURSE c where t.sno=s.sno and t.cno=c.cno/*查询多个表,表表之间的字段列名进行比较,进行表与表之间的内连接,内连接缺点当关联条件有不成立的数据,会被隐藏,不会显示*/
2 select t.sno,s.sname,t.degree,c.cname from SCORE t join STUDENT s on t.sno=s.sno join COURSE c on t.cno=c.cno/*内连接的另外写法,确定一个主表,辅助表则join一个on一个,join关键字则代表连接到主表的含义*/
3 select t.sno,s.sname,t.degree,c.cname from SCORE t full join STUDENT s on t.sno=s.sno full join COURSE c on t.cno=c.cno/*在内连接的基础上,在辅助表join前加full则变为全连接*/

 

posted @ 2016-06-14 23:36  明天会更好!!!!  阅读(134)  评论(0)    收藏  举报