当前位置:网站首页>MySQL第六次作业-查询数据-多条件
MySQL第六次作业-查询数据-多条件
2022-06-26 09:37:00 【m0_61961898】
- 查询教师表中T2到T9之间工资大于2000并且有岗位津贴的教师所有字段数据SELECT * FROM lingjinzhengteacher where no between “T2” and “T9” and
- sal>2000 and comm is not null;
查询教师表中教师姓名不以字母“A”开头的教师所有字段数据,用工资排序,去前三条
select * from lingjinzhengteacher where name not like "a%" order by sal limit 3
查询教师表中工资等于2000或者岗位津贴大于等于1000的教师所有字段数据
select * from lingjinzhengteacher where sal = 2000 or comm >=1000;

4.查询教师表中教师姓名以字母“d”开头并且含有”a”字母的教师号、教师姓名字段数据
select no, name from lingjinzhengteacher where name like "b%a%" ;
5.查询教师表中教师姓名不以字符“e”开头的并且没有岗位津贴的教师号、教师姓名、工资、岗位津贴字段数据,用工资排序
select no, name,sal, comm from lingjinzhengteacher where name not like "e%" and comm is null;
6.查询课程表中带字母”L”的并且课时数大于等于50的课程名称、课时数字段数据
select name, class_hours from lingjinzheng_course where name like "%l%" and class_hours >=50;
7.查询课程表中课程号在C5到C7之间或者没有课时数的所有字段数据
select * from lingjinzheng_course where no between "C5" and "C7" or class_hours is null;
8.查询课程表中课时数不等于45并且课程名以“sh”结尾的课程名称、课时数字段数据
select name, class_hours from lingjinzheng_course where class_hours != 45 and name like "%sh" ;
9.查询课程表中课程号不在C3、C5、C6中或者课时数等于45的所有字段数据,用课时数排序
select * from lingjinzheng_course where no not in ("C3", "C5", "C6") or class_hours = 45 order by class_hours;
查询授课表中序号在2到9之间或者周数为15的序号、教室号、周数字段数据
select id, class_num, week from lingjinzheng_schoolteaching
where id between 2 and 9
or week = 15;
查询授课表中教师号在T2到T9之间并且教室在J栋的教师号、教室号字段数据, 用周数排序
select teacher_no, class_num from lingjinzheng_schoolteaching
-> where teacher_no between "T2" and "T9"
-> and class_num like "J%"
-> order by week;

查询授课表中周数不为空并且周数大于等于50的课程号、教室号、周数字段数据
select course_no, class_num, week from lingjinzheng_schoolteaching
-> where week is not null and week >= 50; ![]()
- 5 查询授课表中教室在一楼或者教室在三楼的所有字段数据, 用周数排序
select * from lingjinzheng_schoolteaching where class_num like "_1%" or class_num like "_3%" order by week;
边栏推荐
- Poj3682 king arthur's birthday celebration (probability)
- 利用foreach循环二维数组
- What is LSP
- Index summary of blog articles -- Industrial Internet
- 美国总统签署社区安全法案以应对枪支问题
- The first batch of 12 enterprises settled in! Opening of the first time-honored product counter in Guangzhou
- [binary search] 4 Find the median of two positive arrays
- MySQL项目8总结
- Omni channel, multi scenario and cross platform, how does app analyze channel traffic with data
- Selection of webrtc video codec type VP8 H264 or other? (openh264 encoding, ffmpeg decoding)
猜你喜欢

MySQL第十次作业-视图

Omni channel, multi scenario and cross platform, how does app analyze channel traffic with data

Automated testing -- Introduction and use of pytest itself and third-party modules

C中字符串基本操作

What is the web SSH service port of wgcloud

【Leetcode】76. Minimum covering substring

Day 3 array, pre post, character space, keyword and address pointer

String constant pool, class constant pool, and runtime constant pool

Standard implementation of streaming layout: a guide to flexboxlayout

Custom interceptor
随机推荐
Recyclerview implements flow layout (LinearLayout with line wrap) (flexboxlayoutmanager)
JVM垃圾回收什么情况会进入老年代
1. 两数之和(LeetCode题目)
JVM的符号引用和直接引用是什么
Global and Chinese markets of children's electronic thermometers 2022-2028: Research Report on technology, participants, trends, market size and share
Problems encountered by jupyter notebook
Selection of webrtc video codec type VP8 H264 or other? (openh264 encoding, ffmpeg decoding)
P1296 whispers of cows (quick row + binary search)
Dialog centered
Appium自动化测试基础 — 移动端测试环境搭建(二)
Develop current learning objectives and methods
MySQL Chapter 5 Summary
The IE mode tab of Microsoft edge browser is stuck, which has been fixed by rolling back the update
MySQL第六章总结
The basis of C language grammar -- factoring by function applet
How to start the learning journey of webrtc native cross platform development?
Custom interceptor
Use of exec series functions (EXECL, execlp, execle, execv, execvp)
全渠道、多场景、跨平台,App如何借助数据分析渠道流量
leetCode-链表的中间结点