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

自己做外贸网站能接到单吗北京建工集团有限公司官网

自己做外贸网站能接到单吗,北京建工集团有限公司官网,flash网站规划,学校网站php源码---恢复内容开始--- 1,用于设定所select出来的数据是否允许出现重复行#xff08;完全相同的数据行#xff09; all#xff1a;允许出现——默认不写就是All#xff08;允许的#xff09;。 distinct#xff1a;不允许出现——就是所谓的“消除重复行” 2#xff0c;whe…---恢复内容开始--- 1,用于设定所select出来的数据是否允许出现重复行完全相同的数据行 all允许出现——默认不写就是All允许的。 distinct不允许出现——就是所谓的“消除重复行” 2where:条件 3group by分组依据 后面加表的字段名通常只进行一个字段的分组 mysql表查询语法形式select [all | distinct] 字段名或表达式 from 表名 [where] [group by] [having] [order by] [limit]; 练习题:共有下面四张表    学生表student  教师表teacher  课程表course 成绩表score            1查询Score表中至少有5名学生选修的并以3开头的课程的平均分数 --操作表score以cno分组并且cno是以3开头取出各个cno的总数及与cno对应的degree的平均值 select count(cno),avg(degree) from score where cno like 3% group by cno;   --从上面的虚拟表中找到cno总数大于5的 select * from (select count(cno) a,avg(degree) b from score where cno like 3% group by cno) c where a5; 2,查询所有学生的Sno、Cname和Degree列 --找到student的sno select sno from student;  --找到score 的sno,degree,cno select sno,degree,cno from score;  --找到course的cno select cno,cname from course;  --组成新表cno sno degree select a.cno,b.sno,b.sname,a.degree from (select sno,degree,cno from score) a  join (select sno,sname from student) b on a.snob.sno;  --组成有cname cno sn degree sname的表 select d.cname,e.cno,e.sno,e.degree,e.sname from   (select a.cno,b.sno,b.sname,a.degree from (select sno,degree,cno from score) a  join (select sno,sname from student) b on a.snob.sno) as e   join   (select cname,cno from course) as d  on d.cnoe.cno; 3查询“95033”班学生的平均分 --从student取sno class,条件是class是95033的 select sno,class from student where class95033; --取出score中sno degree select sno,degree from score; --将上面两张表组成一张,取degree的平均值 select avg(degree) from (select sno,class from student where class95033) a join (select sno,degree from score) b on a.snob.sno; 4,查询选修“3-105”课程的成绩高于“109”号同学成绩的所有同学的记录 --将109号的成绩取出 select degree from score where sno109 and cno3-105; -- 得出最终表 select * from score where degree(select degree from score where sno109 and cno3-105) and cno3-105; 5,查询和学号为108的同学同年出生的所有学生的Sno、Sname和Sbirthday列 --找到student中sno为108 的Sbirthdayselect year(sbirthday) from student where sno108; -- 得出最终表select sno,sname,sbirthday from student where year(sbirthday)(select year(sbirthday) from student where sno108);  6.查询“张旭“教师任课的学生成绩姓名 --找到teacher中tname为张旭的tno select tno from teacher where tname张旭; --找到course中tno和teacher中tname为张旭的tno相同的cno select cno from course where tno(select tno from teacher where tname张旭); --找到score中cno为6-166的sno cno degree select sno,cno,degree from score where cno(select cno from course where tno(select tno from teacher where tname张旭)); --找到student表中与上表sno相同的sname与上表组成新表 select a.sname,b.sno,b.cno,b.degree from (select sno,sname from student) a join (select sno sno,cno,degree from score where cno(select cno from course where tno(select tno from teacher where tname张旭))) b on a.snob.sno; 7,查询考计算机导论的学生成绩--找到course中cname为计算机导论的cnoselect cno from course where cname计算机导论; --找到score中cno与上表中相同时的sno degreeselect sno,degree from score where cno(select cno from course where cname计算机导论); -- 得出最终表select b.sname,a.sno,a.degree from (select sno,degree from score where cno(select cno from course where cname计算机导论)) a join (select sname,sno from student) b on a.snob.sno; 8,查询李诚老师教的课程名称select tno from teacher where tname李诚;select cname,cno from course where tno(select tno from teacher  where tname李诚); 9,查询选修某课程的同学人数多于5人的教师姓名--score以cno分组统计cno的数量select count(cno) a,cno from score group by cno; --找到上表中cno数量大于5的的cnoselect cno from (select count(cno) a,cno from score group by cno) b where a5; --找到与上表cno一致的表course表中的tnoselect tno from course where cno(select cno from (select count(cno) a,cno from score group by cno) b where a5); --与上表tno一致的表teacher中的tnameselect tname from teacher where tno(select tno from course where cno(select cno from (select count(cno) a,cno from score group by cno) b where a5)); 10,查询95033班和95031班全体学生的记录--找到表score中的sno和cno 和degreeselect sno,cno,degree from score;--将上表和student组合select a.sno,a.sname,a.ssex,a.sbirthday,a.class,b.cno,b.degree from (select * from student) a join (select cno,degree,sno from score) b on a.snob.sno; 11,查询存在有85分以上成绩的课程Cnoselect cno,degree from score where degree85; 12,查询出“计算机系“教师所教课程的成绩表--找到teacher中的tno tnameselect tno,tname from teacher where dapart计算机系;--找到course中tno和上表相同的cnoselect a.cno,b.tno,b.tname from (select tno,cno from course) a join (select tno,tname from teacher where dapart计算机系) b on a.tnob.tno;--找到score中cno与上表相同的degreeselect c.sno,c.cno,c.degree,d.tname from (select sno,cno,degree from score) c join (select a.cno,b.tno,b.tname from (select tno,cno from course) a join (select tno,tname from teacher where dapart计算机系) b on a.tnob.tno) d on c.cnod.cno; 13,查询选修编号为“3-105“课程且成绩至少高于选修编号为“3-245”的同学    的Cno、Sno和Degree,并按Degree从高到低次序排序--score中找到cno3-245的degree,取出最小值select min(degree) from score where cno3-245;--score中找到cno3-105的cno sno degree并且degree大于上表的degreeselect cno,sno,degree from score where cno3-105 and degree(select min(degree) from score where cno3-245) order by degree desc; 14,查询选修编号为“3-105”且成绩高于选修编号为“3-245”课程的同学的    Cno、Sno和Degree.--找到score中cno3-245中的degree的最大值select max(degree) from score where cno3-245;--找到score中cno3-105的cno sno degreeselect cno,sno,degree from score where degree(select max(degree) from score where cno3-245) order by degree asc; 15,查询所有教师和同学的name、sex和birthdayselect tname,tsex,tbirthday from teacherunionselect sname,ssex,sbirthday from student;16,查询所有“女”教师和“女”同学的name、sex和birthdayselect tname,tsex,tbirthday from teacher where tsex女unionselect sname,ssex,sbirthday from student where ssex女; 17,查询成绩比该课程平均成绩低的同学的成绩表select avg(degree) from score where cno3-105;select avg(degree) from score where cno3-245;select avg(degree) from score where cno6-166;select * from score where cno3-105 and degree(select avg(degree) from score where cno3-105)unionselect * from score where cno3-245 and degree(select avg(degree) from score where cno3-245)unionselect * from score where cno6-166 and degree(select avg(degree) from score where cno6-166); 18,查询所有任课教师的Tname和Departselect a.tname,a.dapart from (select tno,tname,dapart from teacher) a join (select tno from course) b on a.tnob.tno; 19,查询所有未讲课的教师的Tname和Departselect a.tname,a.dapart from (select tno,tname,dapart from teacher) a join (select tno from course) b on a.tnob.tno; 20,查询至少有2名男生的班号select count(ssex),class from student where ssex男 group by class; select b.class from (select count(ssex) a,class from student where ssex男 group by class) b where a2; 21,查询Student表中不姓“王”的同学记录select * from student where sname not like 王%; 22,查询Student表中每个学生的姓名和年龄select  sname,year(now())-year(sbirthday) from student; 23,查询Student表中最大和最小的Sbirthday日期值select min(day(sbirthday)),max(day(sbirthday)) from student; 24,以班号和年龄从大到小的顺序查询Student表中的全部记录select * from student order by class desc,date(sbirthday) asc; 25,查询“男”教师及其所上的课程select tno from teacher where tsex男;select a.tno,b.cname,a.tname from (select tno,tname from teacher where tsex男) a join (select * from course) b on a.tnob.tno;  转载于:https://www.cnblogs.com/wfc139/p/8939605.html
http://www.zqtcl.cn/news/168068/

相关文章:

  • 网站建设工程师的职位要求化妆品行业网站开发
  • 做海报有什么素材网站知乎什么样的蓝色做网站做好看
  • 餐饮网站建设网站wordpress优酷视频插件下载
  • 什么网站做广告效果好wordpress中文cms
  • seo与网站优化广州洲聚网站开发
  • 建一个自己用的网站要多少钱北京网站建设价格天
  • 免费做婚礼邀请函的网站如何设定旅游网站seo核心关键词
  • 网上做问卷调查赚钱哪些网站好全flash网站制作
  • 个人网站备案核验单填写wordpress登录安全插件下载
  • 拖拽做网站cms系统设计
  • 村建站什么部门网站建设步骤图
  • 移动端网站建设的意义中工信融网站建设
  • 网站设计宽屏尺寸盐城网站建设渠道合作
  • 网站所有者查询hexo做网站
  • 杭州专业网站设计策划大数据网站建设和
  • 建一个自己的网站需要多少钱泰州网站快速排名优化
  • 企业网站的建设企业湖南网络推广
  • 山西省建设厅投诉网站郴州新网交友手机版
  • 营销网站建设是什么flash个人网站欣赏
  • 网站建设最简单的教程视频教程建设厅注册中心网站首页
  • 免费做网站凡科wordpress 分享到微信 插件
  • 购物网站项目建设内容有啥网站是专做时尚穿搭
  • 网上下载的网站模板怎么用wordpress 注册密码
  • 网站建设免费国外撤销网站备案申请书
  • 佛山做网站那家好网站建设公司如何盈利
  • 傻瓜建网站设计感网站
  • 北京网站优化软件陕西省建筑信息平台
  • 广州越秀建网站济南房产网新开楼盘
  • 线上咨询预约网站建设方案保定外贸网站制作
  • 网站流量如何增加提高工作效率的措施