mysql数据库查询练习答案
更新时间:2024-04-24 17:24:01 阅读量: 综合文库 文档下载
1. 已知:员工信息表,表名为:employee Name 张三 李四 王五 薛六 王五 赵七 张四 Sex 女 男 女 女 男 男 女 Age 19 20 25 20 22 28 23 Address 北京 上海 广州 北京 北京 上海 北京 (1). 写出sql语句,查询所有年龄大于20岁的员工(2分) Select * from employee where age > 20
(2). 写出sql语句,查询所有年龄小于25岁的女性员工(3分) Select * from employee where age < 25 and sex = ‘女’
(3). 写出sql语句,统计男女员工各有多少名(3分) Select count(name),sex, from employee group by sex
(4). 写出sql语句,按照年龄倒序获取员工信息(3分) Select * from employee order by age desc
(5). 写出sql语句,获取员工中哪个姓名具有重名现象(3分) Select name from employee group by name having count(name) > 1
(6). 写出sql语句,查询所有姓张的员工(3分) Select * from employee where name like ‘张%’
(7). 写出sql语句,查询住址为北京的前3条记录(3分) --Select top 3 * from employee where address = ‘北京’ Select * from employee where address = ‘北京’ limit 0,3
(8). 写出sql语句,查询员工总数(3分) Select count(*) from employee
(9). 写出sql语句,向表中插入一条记录(2分)
Insert into employee (Name, Sex, Age, Address) values (‘名字’, ‘女’, 12, ‘地址’);
(10).写出sql语句,修改员工张四的住址为南京(2分) Update employee set address = ‘南京’ where name = ‘张四’
(11).写出sql语句,删除年龄大于24岁的女员工(2分) Delete from employee where age > 24 and sex = ‘女’
正在阅读:
mysql数据库查询练习答案04-24
电子信息工程论文 基于GPRS的远程LED显示屏设计毕业论文 - 图文01-09
家长委员会工作职责08-24
“高等学校本科教学质量与教学改革工程”专项资金管理暂行办法11-04
新概念英语 1 Unite 4 Robert isn&39;t well 第7课 P26 青少版新概念英语第一级1A 第单元笔记归纳(原创的406-04
2019年中学生传统文化国学知识竞赛题库(史上最全400题)04-06
第1章 逻辑代数基础作业06-06
冬风的诗歌11-21
超滤技术在生活污水处理回用系统中的应用05-21
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 练习
- 答案
- 数据库
- 查询
- mysql
- 公司食用菌生产与加工示范基地可行性研究报告
- 2010年上海市高中地理学业水平考试试卷及答案16K
- 连续剧温州一家人观后感
- 泰兴经济开发区化工物流业发展情况汇报
- 管道外防腐层PCM检测技术
- 2018二级建造师网上继续教育课题考试及答案
- 医保政策考试入库题目 - 有答案版
- 2015-2020年中国艺术陶瓷市场研究与投资战略咨询报告 - 图文
- 四年级说明文阅读题库
- 海明威
- 演绎推理解题方法指导
- 多孔介质燃烧技术
- 2017年浙江省湖州市中考语文试卷 - 图文
- 塑钢型材生产建设项目可行性研究报告范文 - 图文
- photoshop教程大全 - 图文
- 有机化学人名反应
- 北京版五年级健康教育教案
- 2018年运动控制系统专题市场调研分析报告
- AUTOCAD加载 AcStandards 服务时出错解决方法
- 赤城县旅游业发展总体规划说明书