Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN 技术社区
skill_tree_algorithm
提交
3e0874b6
S
skill_tree_algorithm
项目概览
CSDN 技术社区
/
skill_tree_algorithm
通知
9
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
skill_tree_algorithm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
3e0874b6
编写于
10月 25, 2021
作者:
每日一练社区
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add exercises
上级
56f463fa
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
104 addition
and
2 deletion
+104
-2
data/3.算法高阶/1.leetcode/174_组合两个表/solution.sql
data/3.算法高阶/1.leetcode/174_组合两个表/solution.sql
+7
-0
data/3.算法高阶/1.leetcode/175_第二高的薪水/solution.sql
data/3.算法高阶/1.leetcode/175_第二高的薪水/solution.sql
+7
-0
data/3.算法高阶/1.leetcode/176_第N高的薪水/solution.sql
data/3.算法高阶/1.leetcode/176_第N高的薪水/solution.sql
+11
-0
data/3.算法高阶/1.leetcode/177_分数排名/solution.sql
data/3.算法高阶/1.leetcode/177_分数排名/solution.sql
+9
-0
data/3.算法高阶/1.leetcode/179_连续出现的数字/solution.sql
data/3.算法高阶/1.leetcode/179_连续出现的数字/solution.sql
+14
-0
data/3.算法高阶/1.leetcode/180_超过经理收入的员工/solution.sql
data/3.算法高阶/1.leetcode/180_超过经理收入的员工/solution.sql
+7
-0
data/3.算法高阶/1.leetcode/181_查找重复的电子邮箱/solution.sql
data/3.算法高阶/1.leetcode/181_查找重复的电子邮箱/solution.sql
+5
-0
data/3.算法高阶/1.leetcode/182_从不订购的客户/solution.sql
data/3.算法高阶/1.leetcode/182_从不订购的客户/solution.sql
+5
-0
data/3.算法高阶/1.leetcode/183_部门工资最高的员工/solution.sql
data/3.算法高阶/1.leetcode/183_部门工资最高的员工/solution.sql
+12
-0
data/3.算法高阶/1.leetcode/184_部门工资前三高的所有员工/solution.sql
data/3.算法高阶/1.leetcode/184_部门工资前三高的所有员工/solution.sql
+14
-0
leetcode_helper.py
leetcode_helper.py
+13
-2
未找到文件。
data/3.算法高阶/1.leetcode/174_组合两个表/solution.sql
0 → 100644
浏览文件 @
3e0874b6
select
p
.
FirstName
,
p
.
LastName
,
a
.
City
,
a
.
State
from
Person
p
left
join
Address
a
on
a
.
PersonId
=
p
.
PersonId
\ No newline at end of file
data/3.算法高阶/1.leetcode/175_第二高的薪水/solution.sql
0 → 100644
浏览文件 @
3e0874b6
select
Max
(
Salary
)
SecondHighestSalary
from
Employee
where
(
select
Max
(
Salary
)
from
Employee
)
>
Salary
\ No newline at end of file
data/3.算法高阶/1.leetcode/176_第N高的薪水/solution.sql
0 → 100644
浏览文件 @
3e0874b6
CREATE
FUNCTION
getNthHighestSalary
(
N
INT
)
RETURNS
INT
BEGIN
SET
N
:
=
N
-
1
;
RETURN
(
#
Write
your
MySQL
query
statement
below
.
SELECT
salary
FROM
employee
GROUP
BY
salary
ORDER
BY
salary
DESC
LIMIT
N
,
1
);
\ No newline at end of file
data/3.算法高阶/1.leetcode/177_分数排名/solution.sql
0 → 100644
浏览文件 @
3e0874b6
select
Score
,
(
select
count
(
distinct
Score
)
from
Scores
as
s2
where
s2
.
Score
>=
s1
.
Score
)
Rank
from
Scores
as
s1
order
by
Score
DESC
;
\ No newline at end of file
data/3.算法高阶/1.leetcode/179_连续出现的数字/solution.sql
0 → 100644
浏览文件 @
3e0874b6
#
Write
your
MySQL
query
statement
below
select
distinct
Num
as
ConsecutiveNums
from
(
select
Num
,
if
(
@
pre
=
Num
,
@
count
:
=
@
count
+
1
,
@
count
:
=
1
)
as
nums
,
@
pre
:
=
Num
from
Logs
as
l
,
(
select
@
pre
:
=
null
,
@
count
:
=
1
)
as
pc
)
as
n
where
nums
>=
3
;
\ No newline at end of file
data/3.算法高阶/1.leetcode/180_超过经理收入的员工/solution.sql
0 → 100644
浏览文件 @
3e0874b6
select
name
Employee
from
Employee
e1
where
e1
.
Salary
>
(
select
e2
.
Salary
fromEmployee
e2
where
e1
.
ManagerId
=
e2
.
Id
)
\ No newline at end of file
data/3.算法高阶/1.leetcode/181_查找重复的电子邮箱/solution.sql
0 → 100644
浏览文件 @
3e0874b6
select
Email
from
Person
group
by
Email
having
count
(
Email
)
>
1
;
\ No newline at end of file
data/3.算法高阶/1.leetcode/182_从不订购的客户/solution.sql
0 → 100644
浏览文件 @
3e0874b6
select
c
.
name
Customers
from
Customers
c
left
join
Orders
o
on
o
.
CustomerId
=
c
.
Id
where
o
.
CustomerId
is
null
\ No newline at end of file
data/3.算法高阶/1.leetcode/183_部门工资最高的员工/solution.sql
0 → 100644
浏览文件 @
3e0874b6
SELECT
d
.
NAME
AS
'Department'
,
e
.
NAME
AS
'Employee'
,
e
.
Salary
FROM
employee
e
JOIN
department
d
ON
e
.
departmentId
=
d
.
Id
WHERE
(
e
.
departmentId
,
e
.
Salary
)
IN
(
SELECT
departmentId
,
Max
(
Salary
)
FROM
employee
GROUP
BY
departmentId
);
\ No newline at end of file
data/3.算法高阶/1.leetcode/184_部门工资前三高的所有员工/solution.sql
0 → 100644
浏览文件 @
3e0874b6
SELECT
Department
.
Name
AS
Department
,
e1
.
Name
AS
Employee
,
e1
.
Salary
AS
Salary
FROM
Employee
e1
JOIN
Department
ON
e1
.
DepartmentId
=
Department
.
Id
WHERE
3
>
(
SELECT
COUNT
(
DISTINCT
e2
.
Salary
)
FROM
Employee
e2
WHERE
e2
.
Salary
>
e1
.
Salary
AND
e1
.
DepartmentId
=
e2
.
DepartmentId
)
ORDER
BY
Department
.
Name
,
e1
.
Salary
DESC
\ No newline at end of file
leetcode_helper.py
浏览文件 @
3e0874b6
...
@@ -27,8 +27,17 @@ def leetcode_helper():
...
@@ -27,8 +27,17 @@ def leetcode_helper():
shutil
.
copy
(
cpp_code_src_path
,
cpp_code_dst_path
)
shutil
.
copy
(
cpp_code_src_path
,
cpp_code_dst_path
)
else
:
else
:
cpp_code_dst_path
=
os
.
path
.
join
(
dir
,
'solution.cpp'
)
cpp_code_dst_path
=
os
.
path
.
join
(
dir
,
'solution.cpp'
)
shell_code_dst_path
=
os
.
path
.
join
(
dir
,
'solution.sh'
)
sql_code_dst_path
=
os
.
path
.
join
(
dir
,
'solution.sql'
)
if
not
os
.
path
.
exists
(
cpp_code_dst_path
):
if
not
os
.
path
.
exists
(
cpp_code_dst_path
):
open
(
cpp_code_dst_path
,
'w'
,
encoding
=
'utf-8'
)
open
(
cpp_code_dst_path
,
'w'
,
encoding
=
'utf-8'
)
if
100
<=
int
(
exercises_id
)
and
int
(
exercises_id
)
<
203
:
with
open
(
cpp_code_dst_path
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
cpp_code
=
f
.
read
()
if
cpp_code
==
''
and
not
os
.
path
.
exists
(
shell_code_dst_path
)
and
not
os
.
path
.
exists
(
sql_code_dst_path
):
print
(
cpp_code_dst_path
)
desc_src_path
=
os
.
path
.
join
(
crawer_leetcode_dir
,
str
(
int
(
exercises_id
)
+
1
)
+
'.html'
)
desc_src_path
=
os
.
path
.
join
(
crawer_leetcode_dir
,
str
(
int
(
exercises_id
)
+
1
)
+
'.html'
)
desc_dst_path
=
os
.
path
.
join
(
dir
,
'desc.html'
)
desc_dst_path
=
os
.
path
.
join
(
dir
,
'desc.html'
)
# print(desc_src_path)
# print(desc_src_path)
...
@@ -36,9 +45,11 @@ def leetcode_helper():
...
@@ -36,9 +45,11 @@ def leetcode_helper():
if
os
.
path
.
exists
(
desc_src_path
):
if
os
.
path
.
exists
(
desc_src_path
):
shutil
.
copy
(
desc_src_path
,
desc_dst_path
)
shutil
.
copy
(
desc_src_path
,
desc_dst_path
)
else
:
print
(
"该路径不存在,请检查: {}"
.
format
(
desc_src_path
))
else
:
pass
# print("该路径不存在,请检查: {}".format(desc_src_path))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录