![](https://img-blog.csdnimg.cn/20210728160954518.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Leetcode_数据库刷题
文章平均质量分 54
刷一下sql,记录下笔记,不喜勿喷,谢谢.......
yqdex
这个作者很懒,什么都没留下…
展开
-
Leedcode_数据库刷题_601. 体育馆的人流量
601题. 体育馆的人流量SQL架构:Create table If Not Exists stadium (id int, visit_date DATE NULL, people int)Truncate table stadiuminsert into stadium (id, visit_date, people) values ('1', '2017-01-01', '10')insert into stadium (id, visit_date, people) values ('2'原创 2023-02-22 10:11:31 · 242 阅读 · 0 评论 -
Leetcode_数据库刷题_597. 好友申请 I:总体通过率
597题. 好友申请 I:总体通过率SQL架构:Create table If Not Exists FriendRequest (sender_id int, send_to_id int, request_date date)Create table If Not Exists RequestAccepted (requester_id int, accepter_id int, accept_date date)Truncate table FriendRequestinsert into原创 2021-08-05 15:58:26 · 148 阅读 · 0 评论 -
Leetcode_数据库刷题_585. 2016年的投资
585题. 2016年的投资SQL架构:CREATE TABLE IF NOT EXISTS insurance (PID INTEGER(11), TIV_2015 NUMERIC(15,2), TIV_2016 NUMERIC(15,2), LAT NUMERIC(5,2), LON NUMERIC(5,2) )Truncate table insuranceinsert into insurance (PID, TIV_2015, TIV_2016, LAT, LON) values ('1'原创 2021-08-05 14:26:24 · 113 阅读 · 0 评论 -
Leetcode_数据库刷题_580. 统计各专业学生人数
580题. 统计各专业学生人数SQL架构:CREATE TABLE IF NOT EXISTS student (student_id INT,student_name VARCHAR(45), gender VARCHAR(6), dept_id INT)CREATE TABLE IF NOT EXISTS department (dept_id INT, dept_name VARCHAR(255))Truncate table studentinsert into student (stud原创 2021-08-03 16:25:49 · 535 阅读 · 0 评论 -
Leetcode_数据库刷题_579. 查询员工的累计薪水
579题. 查询员工的累计薪水SQL架构:Create table If Not Exists Employee (Id int, Month int, Salary int)Truncate table Employeeinsert into Employee (Id, Month, Salary) values ('1', '1', '20')insert into Employee (Id, Month, Salary) values ('2', '1', '20')insert into原创 2021-08-02 18:11:51 · 449 阅读 · 1 评论 -
Leetcode_数据库刷题_578. 查询回答率最高的问题
578题. 查询回答率最高的问题SQL架构:Create table If Not Exists survey_log (id int, action varchar(255), question_id int, answer_id int, q_num int, timestamp int)Truncate table survey_loginsert into survey_log (id, action, question_id, answer_id, q_num, timestamp) va原创 2021-07-29 14:48:25 · 162 阅读 · 0 评论 -
Leetcode_数据库刷题_577. 员工奖金
577题. 员工奖金SQL架构:Create table If Not Exists Employee (EmpId int, Name varchar(255), Supervisor int, Salary int)Create table If Not Exists Bonus (EmpId int, Bonus int)Truncate table Employeeinsert into Employee (EmpId, Name, Supervisor, Salary) values (原创 2021-07-29 11:16:30 · 208 阅读 · 1 评论 -
Leetcode_数据库刷题_574. 当选者
574题. 当选者SQL架构:Create table If Not Exists Candidate (id int, Name varchar(255))Create table If Not Exists Vote (id int, CandidateId int)Truncate table Candidateinsert into Candidate (id, Name) values ('1', 'A')insert into Candidate (id, Name) values原创 2021-07-29 10:48:53 · 115 阅读 · 0 评论 -
Leetcode_数据库刷题_571. 给定数字的频率查询中位数
571题. 给定数字的频率查询中位数SQL架构:Create table If Not Exists Numbers (Number int, Frequency int)Truncate table Numbersinsert into Numbers (Number, Frequency) values ('0', '7')insert into Numbers (Number, Frequency) values ('1', '1')insert into Numbers (Number,原创 2021-07-29 10:41:44 · 221 阅读 · 0 评论 -
Leetcode_数据库刷题_570. 至少有5名直接下属的经理
570题. 至少有5名直接下属的经理原创 2021-07-29 10:40:15 · 116 阅读 · 0 评论 -
Leetcode_数据库刷题_569. 员工薪水中位数
569题. 员工薪水中位数SQL架构:Create table If Not Exists Employee (Id int, Company varchar(255), Salary int)Truncate table Employeeinsert into Employee (Id, Company, Salary) values ('1', 'A', '2341')insert into Employee (Id, Company, Salary) values ('2', 'A', '3原创 2021-07-29 10:37:03 · 166 阅读 · 0 评论 -
Leetcode_数据库刷题_511.游戏玩法分析 I&II&III&IV
511题. 游戏玩法分析 IfSQL架构:Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int)Truncate table Activityinsert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5')原创 2021-07-29 10:34:39 · 293 阅读 · 0 评论