- 博客(71)
- 收藏
- 关注
原创 leetcode-mysql 2021-06-04
来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/calculate-special-bonus Table: Employees +-------------+---------+ | Column Name | Type | +-------------+---------+ | employee_id | int | | name | varchar | | salary | int | ...
2021-05-31 21:25:04
259
原创 leetcode-mysql 2021-06-03
Table: Employees +-------------+---------+ | Column Name | Type | +-------------+---------+ | employee_id | int | | name | varchar | | salary | int | +-------------+---------+ employee_id is the primary key for this table. Each row ...
2021-05-31 20:57:16
252
原创 leetcode-mysql 2021-05-31
有一个courses 表 ,有: student(学生) 和 class (课程)。 请列出所有超过或等于5名学生的课。 例如,表: +---------+------------+ | student | class | +---------+------------+ | A | Math | | B | English | | C | Math | | D | Biology | | E ...
2021-05-30 20:18:47
147
原创 leetcode-mysql 2021-05-29
表my_numbers的 num字段包含很多数字,其中包括很多重复的数字。 你能写一个 SQL 查询语句,找到只出现过一次的数字中,最大的一个数字吗? +---+ |num| +---+ | 8 | | 8 | | 3 | | 3 | | 1 | | 4 | | 5 | | 6 | 对于上面给出的样例数据,你的查询语句应该返回如下结果: +---+ |num| +---+ | 6 | 注意: 如果没有只出现一次的数字,输出null。 来源:力扣(LeetCode) 链接:https:/...
2021-05-28 19:48:58
207
原创 leetcode-mysql 2021-05-27
Product 表: +-------------+---------+ | Column Name | Type | +-------------+---------+ | product_id | int | | name | varchar | +-------------+---------+ product_id 是这张表的主键 表中含有产品 id 、产品名称。产品名称都是小写的英文字母,产品名称都是唯一的 Invoice 表: +-------------...
2021-05-26 19:08:49
267
原创 leetcode-mysql 2021-05-26
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/project-employees-ii 【侵删】 ExampleA(项目员工II) Table:Project +-------------+---------+ | Column Name | Type | +-------------+---------+ | project_id | int | | employee_id | int | +-------...
2021-05-25 08:52:19
289
原创 leetcode-mysql 2021-05-25
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/students-and-examinations 【侵删】 ExampleA(学生们参加各科测试的次数) 学生表: Students +---------------+---------+ | Column Name | Type | +---------------+---------+ | student_id | int | | student_name | v...
2021-05-24 20:13:08
424
原创 leetcode-mysql 2021-05-24
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/user-activity-for-the-past-30-days-i 【侵删】 ExampleA (查询近30天活跃用户数) 活动记录表:Activity +---------------+---------+ | Column Name | Type | +---------------+---------+ | user_id | int | | se...
2021-05-23 22:25:56
295
原创 leetcode-mysql 2021-05-17
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/friendly-movies-streamed-last-month 【侵删】 ExampleA (上月播放的儿童适宜电影) 表: TVProgram +---------------+---------+ | Column Name | Type | +---------------+---------+ | program_date | date | | content_...
2021-05-16 21:56:19
254
原创 leetcode-mysql 2021-05-08
来源:Leetcode 地址: https://leetcode-cn.com/problems/percentage-of-users-attended-a-contest/【侵删】 ExampleA (各赛事的用户注册率) 用户表:Users +-------------+---------+ | Column Name | Type | +-------------+---------+ | user_id | int | | user_name | var...
2021-05-08 21:17:20
284
原创 leetcode-mysql 2021-05-07
来源:Leetcode 地址:https://leetcode-cn.com/problems/ad-free-sessions/ 【侵删】 ExampleA: (Ad-Free Sessions) Table: Playback +-------------+------+ | Column Name | Type | +-------------+------+ | session_id | int | | customer_id | int | | start_time | i...
2021-05-06 21:21:03
192
原创 leetcode-mysql 2021-05-06 【临时知识】(关于where group by 以及 having)
Reference:QiaoZhi&江枫渔火L 1、where 后不能跟聚合函数,因为where执行顺序大于聚合函数。 2、where 子句的作用是在对查询结果进行分组前,将不符合where条件的行去掉,即在分组之前过滤数据,条件中不能包含聚组函数,使用where条件显示特定的行。 3、having 子句的作用是筛选满足条件的组,即在分组之后过滤数据,条件中经常包含聚组函数,使用having 条件显示特定的组,也可以使用多个分组标准进行分组。 基本使用顺序:where group ...
2021-05-06 18:40:31
113
原创 leetcode-mysql 2021-05-06
来源:Leetcode 地址:https://leetcode-cn.com/problems/customer-order-frequency/ 【侵删】 ExampleA(消费者下单频率) 表: Customers +---------------+---------+ | Column Name | Type | +---------------+---------+ | customer_id | int | | name | varchar...
2021-05-06 18:24:37
123
原创 leetcode-mysql 2021-05-05
来源:Leetcode 地址:https://leetcode-cn.com/problems/list-the-products-ordered-in-a-period/ 【侵删】 ExampleA(列出指定时间段内所有的下单产品) 表: Products +------------------+---------+ | Column Name | Type | +------------------+---------+ | product_id |...
2021-05-05 21:11:59
120
原创 leetcode-mysql 2021-05-04
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/employee-bonus/【侵删】 ExampleA(员工奖金): 选出所有 bonus < 1000 的员工的 name 及其 bonus。 Employee 表单 +-------+--------+-----------+--------+ | empId | name | supervisor| salary | +-------+--------+-----------+...
2021-05-04 18:06:25
166
原创 leetcode-mysql 2021-05-03
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/unique-orders-and-customers-per-month/【侵删】 ExampleA:(按月统计订单数与顾客数) 表:Orders +---------------+---------+ | Column Name | Type | +---------------+---------+ | order_id | int | | order_da...
2021-05-03 09:43:55
163
原创 leetcode-mysql 2021-05-02
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/weather-type-in-each-country/comments/【侵删】 ExampleA:(不同国家的天气类型) 国家表:Countries +---------------+---------+ | Column Name | Type | +---------------+---------+ | country_id | int | | countr...
2021-05-03 09:23:45
146
原创 leetcode-mysql 2021-04-30
来源:https://leetcode-cn.com/problems/find-users-with-valid-e-mails/ &https://leetcode-cn.com/problems/game-play-analysis-i/ again (shame on me)最近两天的事情有点多,暂时经常练习了但是没有将对应的内容搬到这里来; ExampleA:(查找拥有有效邮箱的用户) 用户表:Users +---------------+---------+ | C...
2021-05-01 21:25:43
195
原创 leetcode-mysql 2021-04-29
罪恶:(自己懈怠了一天多的时间shame on me) 来源:https://leetcode-cn.com/problems/combine-two-tables/ 【侵删】 ExampleA: (表组合) 表1: Person +-------------+---------+ | 列名 | 类型 | +-------------+---------+ | PersonId | int | | FirstName | varchar | | Last...
2021-04-30 21:01:27
233
1
原创 leetcode-mysql 2021-04-28
来源:https://leetcode-cn.com/problems/immediate-food-delivery-i/ 【侵删】 ExampleA:即时食物配送 I 配送表: Delivery +-----------------------------+---------+ | Column Name | Type | +-----------------------------+---------+ | delivery_id ...
2021-04-28 16:09:02
138
原创 leetcode-mysql 2021-04-27
来源:https://leetcode-cn.com/problems/find-total-time-spent-by-each-employee 【侵删修改】 ExampleA: 表: Employees +-------------+------+ | Column Name | Type | +-------------+------+ | emp_id | int | | event_day | date | | in_time | int | | out_tim...
2021-04-27 08:29:35
226
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅