当前位置:网站首页>The sixth MySQL job - query data - multiple conditions
The sixth MySQL job - query data - multiple conditions
2022-06-26 10:28:00 【m0_ sixty-one million nine hundred and sixty-one thousand eight】
- Query the teacher table T2 To T9 The salary is greater than 2000 And there are all field data of teachers with post allowance SELECT * FROM lingjinzhengteacher where no between “T2” and “T9” and
- sal>2000 and comm is not null;
The teacher's name in the query teacher table does not start with a letter “A” All field data of teachers at the beginning , Sort by salary , Go to the first three
select * from lingjinzhengteacher where name not like "a%" order by sal limit 3
Query the salary in the teacher table is equal to 2000 perhaps The post allowance is greater than or equal to 1000 All field data of teachers
select * from lingjinzhengteacher where sal = 2000 or comm >=1000;
4. The teacher's name in the query teacher table is written in letters “d” start also contain ”a” Letter teacher number 、 Teacher name field data
select no, name from lingjinzhengteacher where name like "b%a%" ;
5. The teacher's name in the query teacher table does not use the character “e” At the beginning also Teacher number without post allowance 、 Teacher's name 、 Wages 、 Position allowance field data , Sort by salary
select no, name,sal, comm from lingjinzhengteacher where name not like "e%" and comm is null;
6. Query the curriculum with letters ”L” Of also The number of class hours is greater than or equal to 50 Course name 、 Class digital segment data
select name, class_hours from lingjinzheng_course where name like "%l%" and class_hours >=50;
7. Query the course number in the course schedule C5 To C7 Between perhaps There is no field data for the number of class hours
select * from lingjinzheng_course where no between "C5" and "C7" or class_hours is null;
8. The number of class hours in the query curriculum is not equal to 45 also The course name begins with “sh” Course name at the end 、 Class digital segment data
select name, class_hours from lingjinzheng_course where class_hours != 45 and name like "%sh" ;
9. The course number in the query course table is not in C3、C5、C6 in perhaps The number of class hours is equal to 45 All field data , Sort by class hours
select * from lingjinzheng_course where no not in ("C3", "C5", "C6") or class_hours = 45 order by class_hours;
Query the serial number in the teaching table 2 To 9 Between perhaps The number of weeks is 15 The serial number of 、 Classroom number 、 Week field data
select id, class_num, week from lingjinzheng_schoolteaching
where id between 2 and 9
or week = 15;
Query the teacher number in the teaching table T2 To T9 Between also The classroom is J Dong's teacher number 、 Classroom number field data , Sort by weeks
select teacher_no, class_num from lingjinzheng_schoolteaching
-> where teacher_no between "T2" and "T9"
-> and class_num like "J%"
-> order by week;
The number of weeks in the query teaching table is not empty also The number of weeks is greater than or equal to 50 My course number 、 Classroom number 、 Week field data
select course_no, class_num, week from lingjinzheng_schoolteaching
-> where week is not null and week >= 50;
- 5 The classroom in the inquiry teaching table is on the first floor perhaps All field data of the classroom on the third floor , Sort by weeks
select * from lingjinzheng_schoolteaching where class_num like "_1%" or class_num like "_3%" order by week;
边栏推荐
- echo $?
- Progressive Web 应用程序PWA是应用程序开发的未来
- Today's headline adaptation scheme code
- Basic string operations in C
- 118. 杨辉三角
- 瑞萨电子面向物联网应用推出完整的智能传感器解决方案
- Establishment of smart dialogue platform for wechat official account
- 【LeetCode】59. 螺旋矩阵 II
- 微软 Edge 浏览器 IE 模式标签页出现卡死情况,已通过回滚更新修复
- US President signs community safety act to deal with gun issue
猜你喜欢
【LeetCode】59. Spiral matrix II
MySQL 11th job - view application
DBSCAN
方法区里面有什么——class文件、class文件常量池、运行时常量池
Using foreach to loop two-dimensional array
Renesas electronics launched a complete intelligent sensor solution for Internet of things applications
904. 水果成篮
Omni channel, multi scenario and cross platform, how does app analyze channel traffic with data
How to change the QR code material color of wechat applet
cmake / set 命令
随机推荐
Introduction to stored procedure testing
Constraintlayout control uses full Raiders
MySQL learning summary
cmake / set 命令
开发者,微服务架构到底是什么?
Express (I) - easy to get started
MySQL第八次作业
Progressive Web 应用程序PWA是应用程序开发的未来
MySQL第四章总结
Global and Chinese market for change and configuration management software 2022-2028: Research Report on technology, participants, trends, market size and share
全渠道、多场景、跨平台,App如何借助数据分析渠道流量
MySQL第十四次作业--电子商城项目
Function run time
Based on Zeng Shen's explanation, the line segment tree is studied again one
Solution to the problem of compilation error due to repeated third-party package names
36 qtextedit control input multiline text
创建对象的时候堆内存的分配
String constant pool, class constant pool, and runtime constant pool
MySQL第九次作业-连接查询&子查询
Renesas electronics launched a complete intelligent sensor solution for Internet of things applications