当前位置: 首页 > news >正文

网站建设的毕业设计报告好用的视频播放器app

网站建设的毕业设计报告,好用的视频播放器app,网络运营一个月工资,网站建设是什么时间段申请域名目录 多表查询 【8】多表连接——内连接 🙂等值连接 🙂自然连接 🙂非等值连接 【9】多表连接——外连接 【10】交叉连接不考 【11】联合查询 【12】扩展多表连接 【13】嵌套查询 🙂 多表查询 【8】多表连接——内连…

目录

多表查询 

【8】多表连接——内连接

🙂等值连接

🙂自然连接

🙂非等值连接 

【9】多表连接——外连接

【10】交叉连接不考

【11】联合查询

【12】扩展多表连接

【13】嵌套查询


🙂

多表查询 

【8】多表连接——内连接

  • 等值连接(=)(且包含自然连接--两个字段在一张表中)
  • 非等值连接(< > 等)
  • 关于自然连接必须用别名
  • 用别名必须全部都用别名


🙂等值连接

--查询选课学生及其选课情况//两张表
--select student.sno , student.sname,scores.grade,scores.course
--from student
--join scores on student.sno = scores.sno--select student.sno 学号,student.sname 姓名,classes.DEPT
--from student
--join  classes on student.classno=classes.classno

--查询--查询选课学生及其选课情况//三个个张表
--select student.sno,sname,ssex,student.classno,dept,scores.course,grade//相同的列需要指定表
--from student
--join scores on student.sno=scores.sno 
--join classes on student.classno=classes.classno--在上面基础上查询在80以上的同学
--where的写法
--select student.sno,sname,ssex,student.classno,dept,scores.course,grade
--from student,classes,scores
--where student.sno = scores.sno 
--and student.classno=classes.classno
--and grade>80---取别名的写法
--select s.sno,sname,ssex,s.classno,dept,o.course,grade
--from student s,classes c,scores o
--where s.sno = o.sno 
--and s.classno=c.classno
--and grade>80

 


🙂自然连接

--自然连接
--查询与某某学生同学的同学的学生的学号,姓名和性别student
--select s1.sno,s1.sname,s1.ssex
--from student s1
--join student s2 on s1.sno=s2.sno
--where s2.sno='王曾'


🙂非等值连接 


--查询比大学英语分数高的学科
--select s1.course,s2.course
--from scores s1
--join scores s2 on s1.course>s2.course
--where s2.course='大学英语'//查询某个人
//查询全部人数,计算总的。

【9】多表连接——外连接

 


🙂左外连接🙂右外连接🙂全外连接 

--查看全部学生的课程情况
--全部学生是主表
--select *
--from student left join scores
--on student.sno=scores.sno--查看没有课程成绩的学生
--select *
--from student left join scores
--on student.sno=scores.sno
--where scores.grade=null

【10】交叉连接不考

没有实际意义,任意两个表都可以交叉连接

select student.sno,sname,grade,course
from scores cross join student
//❌不考

 

【11】联合查询


--select count(sno) from student
--union
--select count(grade) from scores

【12】扩展多表连接


--把杨磊的分数加5分
--update scores
--set grade=grade+5
--from student join scores
--on student.sno=scores.sno
--where student.sname='杨磊'

 

【13】嵌套查询

☁in/not int/=的子查询 


🆗🆗 

--例1查询和某某同班的同学
--select * from student
--where sno in(select sno from student where sname='余强')
--例2查询学习大学英语的人数
--select count(*) from student
--where student.sno in(select student.sno from scores join student on scores.sno=student.sno where course='大学英语')
----连接查询搞一下
--select count(*) from student
--join scores on student.sno=scores.sno
--where course='大学英语'

 

☁< > 等比较运算符的any / all子查询

 


🆗🆗

--例1查询高于大学英语这门成绩的平局分的同学信息
--select avg(grade) from scores
--where course='大学英语'
----49.397576--select student.sno,student.sname,scores.grade from student
--join scores on student.sno=scores.sno
--where course='大学英语'
--and grade>=49.397576
--and classno='物流06106'--select * from student
--join scores on student.sno=scores.sno
--where grade>(select avg(grade) from scores where course='大学英语')
//管他呢,查出来就行,考试过了就行啊啊啊啊啊啊啊----例2查询成绩比77高的同学信息
--select * from scores
--where grade >all(select grade from scores where grade=77 and course='大学英语')

 

☁exists子查询


🆗🆗 

--例子查询选修大学英语的同学
select * from student
where exists(select scores.course from student join scores on student.sno=scores.sno where course='大学英语')

 

 ☁数据操作使用子查询

感谢大家,有补充可以在评论区留言!当然因为我们学校期末考试很水,所以以上这些足够应付期末考试,希望大家可以结合自己的情况好好复习!!

http://www.15wanjia.com/news/47579.html

相关文章:

  • 可以做日语翻译的兼职网站app优化方案
  • 个人做新闻网站处罚福州百度seo排名
  • 昆明网站做的好的公司域名收录查询
  • 做教育类的网站名百度竞价排名是以什么形式来计费的广告?
  • 做网站代理工作安全吗关键词优化营销
  • 杂志网站建设营销策划方案内容
  • 信誉比较好的网上做任务的网站优化师培训机构
  • 做网站在阿里云买什么软件深圳网络推广网站
  • 推广运营公司网站拉新注册app拿佣金
  • wordpress好用的企业展示主题今日头条seo
  • 国外作品集网站附近有学电脑培训班吗
  • 新疆生产建设兵团政府网站网络营销推广案例
  • 阿里巴巴国际站网站做销售方案软文营销ppt
  • 网站做系统叫什么名字百度关键词统计
  • 做网站最低服务器配置seo的流程是怎么样的
  • 专业做企业活动的趴网站301313龙虎榜
  • 怎么建设手机网站在线子域名二级域名查询工具
  • 唐山网站制作appseo优化师是什么
  • 用vs做网站原型建站abc
  • wordpress评论主题seo站内优化和站外优化
  • 公司手机版网站模板免费下载营销型网站的公司
  • 重庆专业做网站网络销售平台排名前十
  • 重庆企业网站seo网上推广怎么做
  • 阿里云 部署网站域名网
  • 济南润滑油网站制作灰色关键词代发可测试
  • 服务器怎么用数据库建设网站网络推广公司哪家做得好
  • wordpress相关阅读禁止显示图片东莞网站制作十年乐云seo
  • 阳信网站建设免费的编程自学网站
  • html5微网站信息发布网站有哪些
  • 互动网站设计与制作网站设计专业的公司