SQL278. 实习广场投递简历分析(一)
描述
id | job | date | num |
1 | C++ | 2025-01-02 | 53 |
2 | Python | 2025-01-02 | 23 |
3 | Java | 2025-01-02 | 12 |
4 | Java | 2025-02-03 | 24 |
5 | C++ | 2025-02-03 | 23 |
6 | Python | 2025-02-03 | 34 |
7 | Python | 2025-03-04 | 54 |
8 | C++ | 2025-03-04 | 65 |
9 | Java | 2025-03-04 | 92 |
10 | Java | 2026-01-04 | 230 |
job | cnt |
C++ | 141 |
Java | 128 |
Python | 111 |
示例1
输入:
drop table if exists resume_info; CREATE TABLE resume_info ( id int(4) NOT NULL, job varchar(64) NOT NULL, date date NOT NULL, num int(11) NOT NULL, PRIMARY KEY (id)); INSERT INTO resume_info VALUES (1,'C++','2025-01-02',53), (2,'Python','2025-01-02',23), (3,'Java','2025-01-02',12), (4,'Java','2025-02-03',24), (5,'C++','2025-02-03',23), (6,'Python','2025-02-03',34), (7,'Python','2025-03-04',54), (8,'C++','2025-03-04',65), (9,'Java','2025-03-04',92), (10,'Java','2026-01-04',230);
输出:
C++|141 Java|128 Python|111
Sqlite 解法, 执行用时: 10ms, 内存消耗: 3328KB, 提交时间: 2021-08-30
select job,sum(num) as cnt from resume_info where date >'2025-01-01' and date <'2025-12-31' group by job order by cnt desc;
Sqlite 解法, 执行用时: 10ms, 内存消耗: 3356KB, 提交时间: 2021-08-04
select job ,sum(num) as cnt from resume_info where date LIKE '2025%' group by job order by cnt desc;
Sqlite 解法, 执行用时: 10ms, 内存消耗: 3360KB, 提交时间: 2021-07-21
select job,sum(num) cnt from resume_info where date like '2025%' group by job order by cnt desc
Sqlite 解法, 执行用时: 10ms, 内存消耗: 3368KB, 提交时间: 2021-08-09
select job, sum(num) as number from resume_info where date like '2025%' group by job order by number desc
Sqlite 解法, 执行用时: 10ms, 内存消耗: 3372KB, 提交时间: 2021-09-08
select job,sum(num) as cnt from resume_info where date >'2025-01-01' and date <'2025-12-31' group by job order by cnt desc;