SELECT last_name,salary
FROM employees
#where salary not between 5000 and 12000;WHERE salary <5000OR salary >12000;
2.选择在20或50号部门工作的员工姓名和部门号
SELECT last_name,department_id
FROM employees
#where department_id in (20,50);WHERE department_id =20OR department_id =50;
3.选择公司中没有管理者的员工姓名及job_id
SELECT last_name,job_id,manager_id
FROM employees
WHERE manager_id ISNULL;
SELECT last_name,job_id,manager_id
FROM employees
WHERE manager_id <=>NULL;
4.选择公司中有奖金的员工姓名,工资和奖金级别
SELECT last_name,salary,commission_pct
FROM employees
WHERE commission_pct ISNOTNULL;
SELECT last_name,salary,commission_pct
FROM employees
WHERENOT commission_pct <=>NULL;
5.选择员工姓名的第三个字母是a的员工姓名
SELECT last_name
FROM employees
WHERE last_name LIKE'__a%';
6.选择姓名中有字母a和k的员工姓名
SELECT last_name
FROM employees
WHERE last_name LIKE'%a%k%'OR last_name LIKE'%k%a%';#where last_name like '%a%' and last_name LIKE '%k%';-- where last_name regexp '[a]' and last_name regexp '[k]';
7.显示出表 employees 表中 first_name 以 'e’结尾的员工信息
SELECT first_name,last_name
FROM employees
WHERE first_name LIKE'%e';
SELECT first_name,last_name
FROM employees
WHERE first_name REGEXP'e$';# 以e开头的写法:'^e'
8.显示出表 employees 部门编号在 80-100 之间的姓名、工种
SELECT last_name,job_id
FROM employees
#方式1:推荐WHERE department_id BETWEEN80AND100;#方式2:推荐,与方式1相同#where department_id >= 80 and department_id <= 100;#方式3:仅适用于本题的方式。#where department_id in (80,90,100);SELECT*FROM departments;
如果你项目中一直用的是 Spring Boot,那么恭喜你没有经历过用 Spring 手动集成其它框架的痛苦。
都说 Spring Boot 大大简化了 Spring 框架开发 Web 应用的难度,这里我们通过配置 Hibernate 的两种方式来深刻体会这一点:
使用 Spring 框架集…
计算系数
代码:
MOD 10007
a, b, k, n, m [int(x) for x in input().split()]def pow(a, n):r 1 % MODwhile n:if n & 1: r r * a % MODa a * a % MODn >> 1return rdef C(n, m):r 1 % MODfor i, j in zip(range(n, -1, -1), range(1, m 1)):r …