随笔分类 -  Mysql习题练习

SQL29 计算用户的平均次日留存率
摘要:SQL29 计算用户的平均次日留存率 描述 题目:现在运营想要查看用户在某天刷题后第二天还会再来刷题的平均概率。请你取出相应数据。 示例:question_practice_detail id device_id quest_id result date 1 2138 111 wrong 2021- 阅读全文

posted @ 2023-07-14 17:38 HHHuskie 阅读(43) 评论(0) 推荐(0)

1907. 按分类统计薪水
摘要:1907. 按分类统计薪水 SQL架构 表: Accounts + + + | 列名 | 类型 | + + + | account_id | int | | income | int | + + + account_id 是这个表的主键。 每一行都包含一个银行帐户的月收入的信息。 写出一个 SQL  阅读全文

posted @ 2023-07-04 22:07 HHHuskie 阅读(21) 评论(0) 推荐(0)

1789. 员工的直属部门
摘要:1789. 员工的直属部门 SQL架构 Table: Employee + + + | Column Name | Type | + + + | employee_id | int | | department_id | int | | primary_flag | varchar | + + + 阅读全文

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

1731. 每位经理的下属员工数量
摘要:1731. 每位经理的下属员工数量 SQL架构 Table: Employees + + + | Column Name | Type | + + + | employee_id | int | | name | varchar | | reports_to | int | | age | int 阅读全文

posted @ 2023-07-04 20:11 HHHuskie 阅读(49) 评论(0) 推荐(0)

1661. 每台机器的进程平均运行时间
摘要:1661. 每台机器的进程平均运行时间 SQL架构 表: Activity + + + | Column Name | Type | + + + | machine_id | int | | process_id | int | | activity_type | enum | | timestam 阅读全文

posted @ 2023-07-04 19:52 HHHuskie 阅读(113) 评论(0) 推荐(0)

1633. 各赛事的用户注册率
摘要:1633. 各赛事的用户注册率 SQL架构 用户表: Users + + + | Column Name | Type | + + + | user_id | int | | user_name | varchar | + + + user_id 是该表的主键。 该表中的每行包括用户 ID 和用户名 阅读全文

posted @ 2023-07-04 19:34 HHHuskie 阅读(21) 评论(0) 推荐(0)

1517. 查找拥有有效邮箱的用户
摘要:1517. 查找拥有有效邮箱的用户 SQL架构 用户表: Users + + + | Column Name | Type | + + + | user_id | int | | name | varchar | | mail | varchar | + + + user_id (用户 ID)是该表 阅读全文

posted @ 2023-07-04 17:44 HHHuskie 阅读(63) 评论(0) 推荐(0)

1341. 电影评分
摘要:1341. 电影评分 SQL架构 表:Movies + + + | Column Name | Type | + + + | movie_id | int | | title | varchar | + + + movie_id 是这个表的主键。 title 是电影的名字。 表:Users + + 阅读全文

posted @ 2023-07-03 22:38 HHHuskie 阅读(34) 评论(0) 推荐(0)

1327. 列出指定时间段内所有的下单产品
摘要:1327. 列出指定时间段内所有的下单产品 SQL架构 表: Products + + + | Column Name | Type | + + + | product_id | int | | product_name | varchar | | product_category | varcha 阅读全文

posted @ 2023-07-03 22:10 HHHuskie 阅读(15) 评论(0) 推荐(0)

1321. 餐馆营业额变化增长
摘要:1321. 餐馆营业额变化增长 SQL架构 表: Customer + + + | Column Name | Type | + + + | customer_id | int | | name | varchar | | visited_on | date | | amount | int | + 阅读全文

posted @ 2023-07-01 21:06 HHHuskie 阅读(32) 评论(0) 推荐(0)

1280. 学生们参加各科测试的次数
摘要:1280. 学生们参加各科测试的次数 SQL架构 学生表: Students + + + | Column Name | Type | + + + | student_id | int | | student_name | varchar | + + + 主键为 student_id(学生ID),该 阅读全文

posted @ 2023-07-01 20:53 HHHuskie 阅读(22) 评论(0) 推荐(0)

1204. 最后一个能进入电梯的人
摘要:1204. 最后一个能进入电梯的人 SQL架构 表: Queue + + + | Column Name | Type | + + + | person_id | int | | person_name | varchar | | weight | int | | turn | int | + + 阅读全文

posted @ 2023-06-30 17:06 HHHuskie 阅读(28) 评论(0) 推荐(0)

1193. 每月交易 I
摘要:1193. 每月交易 I SQL架构 Table: Transactions + + + | Column Name | Type | + + + | id | int | | country | varchar | | state | enum | | amount | int | | trans 阅读全文

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

1070. 产品销售分析 III
摘要:1070. 产品销售分析 III SQL架构 销售表 Sales: + + + | Column Name | Type | + + + | sale_id | int | | product_id | int | | year | int | | quantity | int | | price 阅读全文

posted @ 2023-06-30 15:57 HHHuskie 阅读(25) 评论(0) 推荐(0)

602. 好友申请 II :谁有最多的好友
摘要:602. 好友申请 II :谁有最多的好友 SQL架构 在 Facebook 或者 Twitter 这样的社交应用中,人们经常会发好友申请也会收到其他人的好友申请。 RequestAccepted 表: + + + | Column Name | Type | + + + | requester_i 阅读全文

posted @ 2023-06-30 14:38 HHHuskie 阅读(41) 评论(0) 推荐(0)

601. 体育馆的人流量
摘要:601. 体育馆的人流量 SQL架构 表:Stadium + + + | Column Name | Type | + + + | id | int | | visit_date | date | | people | int | + + + visit_date 是表的主键 每日人流量信息被记录在 阅读全文

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

585. 2016年的投资
摘要:585. 2016年的投资 SQL架构 写一个查询语句,将 2016 年 (TIV_2016) 所有成功投资的金额加起来,保留 2 位小数。 对于一个投保人,他在 2016 年成功投资的条件是: 他在 2015 年的投保额 (TIV_2015) 至少跟一个其他投保人在 2015 年的投保额相同。 他 阅读全文

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

1045. 买下所有产品的客户
摘要:1045. 买下所有产品的客户 SQL架构 Customer 表: + + + | Column Name | Type | + + + | customer_id | int | | product_key | int | + + + product_key 是 Customer 表的外键。 Pr 阅读全文

posted @ 2023-06-30 13:12 HHHuskie 阅读(33) 评论(0) 推荐(0)

626. 换座位
摘要:626. 换座位 SQL架构 表: Seat + + + | Column Name | Type | + + + | id | int | | name | varchar | + + + Id是该表的主键列。 该表的每一行都表示学生的姓名和ID。 Id是一个连续的增量。 编写SQL查询来交换每两 阅读全文

posted @ 2023-06-30 11:19 HHHuskie 阅读(20) 评论(0) 推荐(0)

619. 只出现一次的最大数字
摘要:619. 只出现一次的最大数字 SQL架构 MyNumbers 表: + + + | Column Name | Type | + + + | num | int | + + + 这张表没有主键。可能包含重复数字。 这张表的每一行都含有一个整数。 单一数字 是在 MyNumbers 表中只出现一次的 阅读全文

posted @ 2023-06-30 11:08 HHHuskie 阅读(18) 评论(0) 推荐(0)

导航