随笔分类 -  Mysql习题练习

610. 判断三角形
摘要:610. 判断三角形 SQL架构 表: Triangle + + + | Column Name | Type | + + + | x | int | | y | int | | z | int | + + + (x, y, z)是该表的主键列。 该表的每一行包含三个线段的长度。 写一个SQL查询, 阅读全文

posted @ 2023-06-29 20:52 HHHuskie 阅读(50) 评论(0) 推荐(0)

570. 至少有5名直接下属的经理
摘要:570. 至少有5名直接下属的经理 SQL架构 表: Employee + + + | Column Name | Type | + + + | id | int | | name | varchar | | department | varchar | | managerId | int | + 阅读全文

posted @ 2023-06-29 20:43 HHHuskie 阅读(36) 评论(0) 推荐(0)

550. 游戏玩法分析 IV
摘要:550. 游戏玩法分析 IV SQL架构 Table: Activity + + + | Column Name | Type | + + + | player_id | int | | device_id | int | | event_date | date | | games_played | 阅读全文

posted @ 2023-06-29 20:13 HHHuskie 阅读(26) 评论(0) 推荐(0)

262. 行程和用户
摘要:262. 行程和用户 SQL架构 表:Trips + + + | Column Name | Type | + + + | id | int | | client_id | int | | driver_id | int | | city_id | int | | status | enum | | 阅读全文

posted @ 2023-06-29 16:32 HHHuskie 阅读(41) 评论(0) 推荐(0)

185. 部门工资前三高的所有员工
摘要:185. 部门工资前三高的所有员工 SQL架构 表: Employee + + + | Column Name | Type | + + + | id | int | | name | varchar | | salary | int | | departmentId | int | + + + I 阅读全文

posted @ 2023-06-29 15:32 HHHuskie 阅读(24) 评论(0) 推荐(0)

180. 连续出现的数字
摘要:180. 连续出现的数字 SQL架构 表:Logs + + + | Column Name | Type | + + + | id | int | | num | varchar | + + + id 是这个表的主键。 编写一个 SQL 查询,查找所有至少连续出现三次的数字。 返回的结果表中的数据可 阅读全文

posted @ 2023-06-29 14:26 HHHuskie 阅读(23) 评论(0) 推荐(0)

1164. 指定日期的产品价格
摘要:产品数据表: Products+ + +| Column Name | Type |+ + +| product_id | int || new_price | int || change_date | date |+ + +这张表的主键是 (product_id, change_date)。这张表 阅读全文

posted @ 2023-06-29 11:39 HHHuskie 阅读(52) 评论(0) 推荐(0)

Mysql十题
摘要:181. 超过经理收入的员工 SQL架构 表:Employee + + + | Column Name | Type | + + + | id | int | | name | varchar | | salary | int | | managerId | int | + + + Id是该表的主键 阅读全文

posted @ 2023-06-29 11:15 HHHuskie 阅读(27) 评论(0) 推荐(0)

Mysql必备技能点
摘要:一、SQL顺序 1.sql语句执行顺序:from-->where-->group by -->having --> select >distinct >order by >limit/offset; 我们先执行from,join来确定表之间的连接关系,得到初步的数据 where对数据进行普通的初步的 阅读全文

posted @ 2023-06-29 10:39 HHHuskie 阅读(38) 评论(0) 推荐(0)

数据库字符匹配
摘要: 阅读全文

posted @ 2022-11-21 17:54 HHHuskie 阅读(21) 评论(0) 推荐(0)

SQL35 浙大不同难度题目的正确率
摘要:select difficult_level, avg(if(qpd.result='right', 1, 0)) as correct_rate # sum(if(qpd.result='right', 1, 0)) / count(qpd.question_id) as correct_rate 阅读全文

posted @ 2022-11-21 17:38 HHHuskie 阅读(49) 评论(0) 推荐(0)

SQL34 统计复旦用户8月练题情况
摘要:select up.device_id, '复旦大学' as university, count(question_id) as question_cnt, sum(if(qpd.result='right', 1, 0)) as right_question_cnt from user_profi 阅读全文

posted @ 2022-11-15 20:40 HHHuskie 阅读(33) 评论(0) 推荐(0)

导航