# Database

[Leetcode](https://leetcode.com/problemset/database/) database problem set

* [175.(Easy)组合两个表](https://zqt0.gitbook.io/leetcode/sql/175.combine-two-tables)
* [176.(Easy)第二高的薪水](https://zqt0.gitbook.io/leetcode/sql/176.second-highest-salary)
* [177.(Medium)第N高的薪水](https://zqt0.gitbook.io/leetcode/sql/177.nth-highest-salary)
* [178.(Medium)分数排名](https://zqt0.gitbook.io/leetcode/sql/178.rank-scores)
* [180.(Medium)连续出现的数字](https://zqt0.gitbook.io/leetcode/sql/180.consecutive-numbers)
* [181.(Easy)超过经理收入的员工](https://zqt0.gitbook.io/leetcode/sql/181.employees-earning-more-than-their-managers)
* [182.(Easy)查找重复的电子邮箱](https://zqt0.gitbook.io/leetcode/sql/182.duplicate-emails)
* [183.(Easy)从不订购的客户](https://zqt0.gitbook.io/leetcode/sql/183.customers-who-never-order)
* [184.(Medium)部门工资最高的员工](https://zqt0.gitbook.io/leetcode/sql/184.department-highest-salary)
* [185.(Hard)部门工资前三高的所有员工](https://zqt0.gitbook.io/leetcode/sql/185.department-top-three-salaries)
* [196.(Easy)删除重复的电子邮箱](https://zqt0.gitbook.io/leetcode/sql/196.delete-duplicate-emails)
* [197.(Easy)上升的温度](https://zqt0.gitbook.io/leetcode/sql/197.rising-temperature)
* [262.(Hard)行程和用户](https://zqt0.gitbook.io/leetcode/sql/262.trips-and-users)
* [511.(Easy)游戏玩法分析 I](https://zqt0.gitbook.io/leetcode/sql/511.game-play-analysis-i)
* [512.(Easy)游戏玩法分析 II](https://zqt0.gitbook.io/leetcode/sql/512.game-play-analysis-ii)
* [534.(Medium)游戏玩法分析 III](https://zqt0.gitbook.io/leetcode/sql/534.game-play-analysis-iii)
* [550.(Medium)游戏玩法分析 IV](https://zqt0.gitbook.io/leetcode/sql/550.game-play-analysis-iv)
* [569.(Hard)员工薪水中位数](https://zqt0.gitbook.io/leetcode/sql/569.median-employee-salary)
* [570.(Medium)至少有5名直接下属的经理](https://zqt0.gitbook.io/leetcode/sql/570.managers-with-at-least-5-direct-reports)
* [571.(Hard)给定数字的频率查询中位数](https://zqt0.gitbook.io/leetcode/sql/571.find-median-given-frequency-of-numbers)
* [574.(Medium)当选者](https://zqt0.gitbook.io/leetcode/sql/574.winning-candidate)
* [577.(Easy)员工奖金](https://zqt0.gitbook.io/leetcode/sql/577.employee-bonus)
* [578.(Medium)查询回答率最高的问题](https://zqt0.gitbook.io/leetcode/sql/578.get-highest-answer-rate-question)
* [579.(Hard)查询员工的累计薪水](https://zqt0.gitbook.io/leetcode/sql/579.find-cumulative-salary-of-an-employee)
* [580.(Medium)统计各专业学生人数](https://zqt0.gitbook.io/leetcode/sql/580.count-student-number-in-departments)
* [584.(Easy)寻找用户推荐人](https://zqt0.gitbook.io/leetcode/sql/584.find-customer-referee)
* [585.(Medium)2016年的投资](https://zqt0.gitbook.io/leetcode/sql/585.investments-in-2016)
* [586.(Easy)订单最多的客户](https://zqt0.gitbook.io/leetcode/sql/586.customer-placing-the-largest-number-of-orders)
* [595.(Easy)大的国家](https://zqt0.gitbook.io/leetcode/sql/595.big-countries)
* [596.(Easy)超过5名学生的课](https://zqt0.gitbook.io/leetcode/sql/596.classes-more-than-5-students)
* [597.(Easy)好友申请 I：总体通过率](https://zqt0.gitbook.io/leetcode/sql/597.friend-requests-i-overall-acceptance-rate)
* [601.(Hard)体育馆的人流量](https://zqt0.gitbook.io/leetcode/sql/601.human-traffic-of-stadium)
* [602.(Medium)好友申请 II ：谁有最多的好友](https://zqt0.gitbook.io/leetcode/sql/602.friend-requests-ii-who-has-the-most-friends)
* [603.(Easy)连续空余座位](https://zqt0.gitbook.io/leetcode/sql/603.consecutive-available-seats)
* [607.(Easy)销售员](https://zqt0.gitbook.io/leetcode/sql/607.sales-person)
* [608.(Medium)树节点](https://zqt0.gitbook.io/leetcode/sql/608.tree-node)
* [610.(Easy)判断三角形](https://zqt0.gitbook.io/leetcode/sql/610.triangle-judgement)
* [612.(Medium)平面上的最近距离](https://zqt0.gitbook.io/leetcode/sql/612.shortest-distance-in-a-plane)
* [613.(Easy)直线上的最近距离](https://zqt0.gitbook.io/leetcode/sql/613.shortest-distance-in-a-line)
* [614.(Medium)二级关注者](https://zqt0.gitbook.io/leetcode/sql/614.second-degree-follower)
* [615.(Hard)平均工资：部门与公司比较](https://zqt0.gitbook.io/leetcode/sql/615.average-salary-departments-vs-company)
* [618.(Hard)学生地理信息报告](https://zqt0.gitbook.io/leetcode/sql/618.students-report-by-geography)
* [619.(Easy)只出现一次的最大数字](https://zqt0.gitbook.io/leetcode/sql/619.biggest-single-number)
* [620.(Easy)有趣的电影](https://zqt0.gitbook.io/leetcode/sql/620.not-boring-movies)
* [626.(Medium)换座位](https://zqt0.gitbook.io/leetcode/sql/626.exchange-seats)
* [627.(Easy)变更性别](https://zqt0.gitbook.io/leetcode/sql/627.swap-salary)
* [1045.(Medium)买下所有产品的客户](https://zqt0.gitbook.io/leetcode/sql/1045.customers-who-bought-all-products)
* [1050.(Easy)合作过至少三次的演员和导演](https://zqt0.gitbook.io/leetcode/sql/1050.actors-and-directors-who-cooperated-at-least-three-times)
* [1068.(Easy)产品销售分析 I](https://zqt0.gitbook.io/leetcode/sql/1068.product-sales-analysis-i)
* [1069.(Easy)产品销售分析 II](https://zqt0.gitbook.io/leetcode/sql/1069.product-sales-analysis-ii)
* [1070.(Medium)产品销售分析 III](https://zqt0.gitbook.io/leetcode/sql/1070.product-sales-analysis-iii)
* [1075.(Easy)项目员工 I](https://zqt0.gitbook.io/leetcode/sql/1075.project-employees-i)
* [1076.(Easy)项目员工II](https://zqt0.gitbook.io/leetcode/sql/1076.project-employees-ii)
* [1077.(Medium)项目员工 III](https://zqt0.gitbook.io/leetcode/sql/1077.project-employees-iii)
* [1082.(Easy)销售分析 I](https://zqt0.gitbook.io/leetcode/sql/1082.sales-analysis-i)
* [1083.(Easy)销售分析 II](https://zqt0.gitbook.io/leetcode/sql/1083.sales-analysis-ii)
* [1084.(Easy)销售分析III](https://zqt0.gitbook.io/leetcode/sql/1084.sales-analysis-iii)
* [1097.(Hard)游戏玩法分析 V](https://zqt0.gitbook.io/leetcode/sql/1097.game-play-analysis-v)
* [1098.(Medium)小众书籍](https://zqt0.gitbook.io/leetcode/sql/1098.unpopular-books)
* [1107.(Medium)每日新用户统计](https://zqt0.gitbook.io/leetcode/sql/1107.new-users-daily-count)
* [1112.(Medium)每位学生的最高成绩](https://zqt0.gitbook.io/leetcode/sql/1112.highest-grade-for-each-student)
* [1113.(Easy)报告的记录](https://zqt0.gitbook.io/leetcode/sql/1113.reported-posts)
* [1126.(Medium)查询活跃业务](https://zqt0.gitbook.io/leetcode/sql/1126.active-businesses)
* [1127.(Hard)用户购买平台](https://zqt0.gitbook.io/leetcode/sql/1127.user-purchase-platform)
* [1132.(Medium)报告的记录 II](https://zqt0.gitbook.io/leetcode/sql/1132.reported-posts-ii)
* [1141.(Easy)查询近30天活跃用户数](https://zqt0.gitbook.io/leetcode/sql/1141.user-activity-for-the-past-30-days-i)
* [1142.(Easy)过去30天的用户活动 II](https://zqt0.gitbook.io/leetcode/sql/1142.user-activity-for-the-past-30-days-ii)
* [1148.(Easy)文章浏览 I](https://zqt0.gitbook.io/leetcode/sql/1148.article-views-i)
* [1149.(Medium)文章浏览 II](https://zqt0.gitbook.io/leetcode/sql/1149.article-views-ii)
* [1158.(Medium)市场分析 I](https://zqt0.gitbook.io/leetcode/sql/1158.market-analysis-i)
* [1159.(Hard)市场分析 II](https://zqt0.gitbook.io/leetcode/sql/1159.market-analysis-ii)
* [1164.(Medium)指定日期的产品价格](https://zqt0.gitbook.io/leetcode/sql/1164.product-price-at-a-given-date)
* [1173.(Easy)即时食物配送 I](https://zqt0.gitbook.io/leetcode/sql/1173.immediate-food-delivery-i)
* [1174.(Medium)即时食物配送 II](https://zqt0.gitbook.io/leetcode/sql/1174.immediate-food-delivery-ii)
* [1179.(Easy)重新格式化部门表](https://zqt0.gitbook.io/leetcode/sql/1179.reformat-department-table)
* [1193.(Medium)每月交易 I](https://zqt0.gitbook.io/leetcode/sql/1193.monthly-transactions-i)
* [1194.(Hard)锦标赛优胜者](https://zqt0.gitbook.io/leetcode/sql/1194.tournament-winners)
* [1204.(Medium)最后一个能进入电梯的人](https://zqt0.gitbook.io/leetcode/sql/1204.last-person-to-fit-in-the-elevator)
* [1205.(Medium)每月交易II](https://zqt0.gitbook.io/leetcode/sql/1205.monthly-transactions-ii)
* [1211.(Easy)查询结果的质量和占比](https://zqt0.gitbook.io/leetcode/sql/1211.queries-quality-and-percentage)
* [1212.(Medium)查询球队积分](https://zqt0.gitbook.io/leetcode/sql/1212.team-scores-in-football-tournament)
* [1225.(Hard)报告系统状态的连续日期](https://zqt0.gitbook.io/leetcode/sql/1225.report-contiguous-dates)
* [1241.(Easy)每个帖子的评论数](https://zqt0.gitbook.io/leetcode/sql/1241.number-of-comments-per-post)
* [1251.(Easy)平均售价](https://zqt0.gitbook.io/leetcode/sql/1251.average-selling-price)
* [1264.(Medium)页面推荐](https://zqt0.gitbook.io/leetcode/sql/1264.page-recommendations)
* [1270.(Medium)向公司CEO汇报工作的所有人](https://zqt0.gitbook.io/leetcode/sql/1270.all-people-report-to-the-given-manager)
* [1280.(Easy)学生们参加各科测试的次数](https://zqt0.gitbook.io/leetcode/sql/1280.students-and-examinations)
* [1285.(Medium)找到连续区间的开始和结束数字](https://zqt0.gitbook.io/leetcode/sql/1285.find-the-start-and-end-number-of-continuous-ranges)
* [1294.(Easy)不同国家的天气类型](https://zqt0.gitbook.io/leetcode/sql/1294.weather-type-in-each-country)
* [1303.(Easy)求团队人数](https://zqt0.gitbook.io/leetcode/sql/1303.find-the-team-size)
* [1308.(Medium)不同性别每日分数总计](https://zqt0.gitbook.io/leetcode/sql/1308.running-total-for-different-genders)
* [1321.(Medium)餐馆营业额变化增长](https://zqt0.gitbook.io/leetcode/sql/1321.restaurant-growth)
* [1322.(Easy)广告效果](https://zqt0.gitbook.io/leetcode/sql/1322.ads-performance)
* [1327.(Easy)列出指定时间段内所有的下单产品](https://zqt0.gitbook.io/leetcode/sql/1327.list-the-products-ordered-in-a-period)
* [1336.(Hard)每次访问的交易次数](https://zqt0.gitbook.io/leetcode/sql/1336.number-of-transactions-per-visit)
* [1341.(Medium)电影评分](https://zqt0.gitbook.io/leetcode/sql/1341.movie-rating)
* [1350.(Easy)院系无效的学生](https://zqt0.gitbook.io/leetcode/sql/1350.students-with-invalid-departments)
* [1355.(Medium)活动参与者](https://zqt0.gitbook.io/leetcode/sql/1355.activity-participants)
* [1364.(Medium)顾客的可信联系人数量](https://zqt0.gitbook.io/leetcode/sql/1364.number-of-trusted-contacts-of-a-customer)
* [1369.(Hard)获取最近第二次的活动](https://zqt0.gitbook.io/leetcode/sql/1369.get-the-second-most-recent-activity)
* [1378.(Easy)使用唯一标识码替换员工ID](https://zqt0.gitbook.io/leetcode/sql/1378.replace-employee-id-with-the-unique-identifier)
* [1384.(Hard)按年度列出销售总额](https://zqt0.gitbook.io/leetcode/sql/1384.total-sales-amount-by-year)
* [1393.(Medium)股票的资本损益](https://zqt0.gitbook.io/leetcode/sql/1393.capital-gainloss)
* [1398.(Medium)购买了产品 A 和产品 B 却没有购买产品 C 的顾客](https://zqt0.gitbook.io/leetcode/sql/1398.customers-who-bought-products-a-and-b-but-not-c)
* [1407.(Easy)排名靠前的旅行者](https://zqt0.gitbook.io/leetcode/sql/1407.top-travellers)
* [1412.(Hard)查找成绩处于中游的学生](https://zqt0.gitbook.io/leetcode/sql/1412.find-the-quiet-students-in-all-exams)
* [1421.(Medium)净现值查询](https://zqt0.gitbook.io/leetcode/sql/1421.npv-queries)
* [1435.(Easy)制作会话柱状图](https://zqt0.gitbook.io/leetcode/sql/1435.create-a-session-bar-chart)
* [1440.(Medium)计算布尔表达式的值](https://zqt0.gitbook.io/leetcode/sql/1440.evaluate-boolean-expression)
* [1445.(Medium)苹果和桔子](https://zqt0.gitbook.io/leetcode/sql/1445.apples-oranges)
* [1454.(Medium)活跃用户](https://zqt0.gitbook.io/leetcode/sql/1454.active-users)
* [1459.(Medium)矩形面积](https://zqt0.gitbook.io/leetcode/sql/1459.rectangles-area)
* [1468.(Medium)计算税后工资](https://zqt0.gitbook.io/leetcode/sql/1468.calculate-salaries)
* [1479.(Hard)周内每天的销售情况](https://zqt0.gitbook.io/leetcode/sql/1479.sales-by-day-of-the-week)
* [1485.(Easy)按日期分组销售产品](https://zqt0.gitbook.io/leetcode/sql/1485.group-sold-products-by-the-date)
* [1495.(Easy)上月播放的儿童适宜电影](https://zqt0.gitbook.io/leetcode/sql/1495.friendly-movies-streamed-last-month)
* [1501.(Medium)可以放心投资的国家](https://zqt0.gitbook.io/leetcode/sql/1501.countries-you-can-safely-invest-in)
* [1511.(Easy)消费者下单频率](https://zqt0.gitbook.io/leetcode/sql/1511.customer-order-frequency)
* [1517.(Easy)查找拥有有效邮箱的用户](https://zqt0.gitbook.io/leetcode/sql/1517.find-users-with-valid-e-mails)
* [1527.(Easy)患某种疾病的患者](https://zqt0.gitbook.io/leetcode/sql/1527.patients-with-a-condition)
* [1532.(Medium)最近的三笔订单](https://zqt0.gitbook.io/leetcode/sql/1532.the-most-recent-three-orders)
* [1543.(Easy)产品名称格式修复](https://zqt0.gitbook.io/leetcode/sql/1543.fix-product-name-format)
* [1549.(Medium)每件商品的最新订单](https://zqt0.gitbook.io/leetcode/sql/1549.the-most-recent-orders-for-each-product)
* [1555.(Medium)银行账户概要](https://zqt0.gitbook.io/leetcode/sql/1555.bank-account-summary)
* [1565.(Easy)按月统计订单数与顾客数](https://zqt0.gitbook.io/leetcode/sql/1565.unique-orders-and-customers-per-month)
* [1571.(Easy)仓库经理](https://zqt0.gitbook.io/leetcode/sql/1571.warehouse-manager)
* [1581.(Easy)进店却未进行过交易的顾客](https://zqt0.gitbook.io/leetcode/sql/1581.customer-who-visited-but-did-not-make-any-transactions)
* [1587.(Easy)银行账户概要 II](https://zqt0.gitbook.io/leetcode/sql/1587.bank-account-summary-ii)
* [1596.(Medium)每位顾客最经常订购的商品](https://zqt0.gitbook.io/leetcode/sql/1596.the-most-frequently-ordered-products-for-each-customer)
* [1607.(Easy)没有卖出的卖家](https://zqt0.gitbook.io/leetcode/sql/1607.sellers-with-no-sales)
* [1613.(Medium)找到遗失的ID](https://zqt0.gitbook.io/leetcode/sql/1613.find-the-missing-ids)
* [1623.(Easy)三人国家代表队](https://zqt0.gitbook.io/leetcode/sql/1623.all-valid-triplets-that-can-represent-a-country)
* [1633.(Easy)各赛事的用户注册率](https://zqt0.gitbook.io/leetcode/sql/1633.percentage-of-users-attended-a-contest)
* [1635.(Hard)Hopper 公司查询 I](https://zqt0.gitbook.io/leetcode/sql/1635.hopper-company-queries-i)
* [1645.(Hard)Hopper Company Queries II](https://zqt0.gitbook.io/leetcode/sql/1645.hopper-company-queries-ii)
* [1651.(Hard)Hopper Company Queries III](https://zqt0.gitbook.io/leetcode/sql/1651.hopper-company-queries-iii)
* [1661.(Easy)每台机器的进程平均运行时间](https://zqt0.gitbook.io/leetcode/sql/1661.average-time-of-process-per-machine)
* [1667.(Easy)修复表中的名字](https://zqt0.gitbook.io/leetcode/sql/1667.fix-names-in-a-table)
* [1677.(Easy)发票中的产品金额](https://zqt0.gitbook.io/leetcode/sql/1677.products-worth-over-invoices)
* [1683.(Easy)无效的推文](https://zqt0.gitbook.io/leetcode/sql/1683.invalid-tweets)
* [1693.(Easy)每天的领导和合伙人](https://zqt0.gitbook.io/leetcode/sql/1693.daily-leads-and-partners)
* [1699.(Medium)两人之间的通话次数](https://zqt0.gitbook.io/leetcode/sql/1699.number-of-calls-between-two-persons)
* [1709.(Medium)访问日期之间最大的空档期](https://zqt0.gitbook.io/leetcode/sql/1709.biggest-window-between-visits)
* [1715.(Medium)苹果和橘子的个数](https://zqt0.gitbook.io/leetcode/sql/1715.count-apples-and-oranges)
* [1729.(Easy)求关注者的数量](https://zqt0.gitbook.io/leetcode/sql/1729.find-followers-count)
* [1731.(Easy)每位经理的下属员工数量](https://zqt0.gitbook.io/leetcode/sql/1731.the-number-of-employees-which-report-to-each-employee)
* [1741.(Easy)查找每个员工花费的总时间](https://zqt0.gitbook.io/leetcode/sql/1741.find-total-time-spent-by-each-employee)
* [1747.(Medium)应该被禁止的Leetflex账户](https://zqt0.gitbook.io/leetcode/sql/1747.leetflex-banned-accounts)
* [1757.(Easy)可回收且低脂的产品](https://zqt0.gitbook.io/leetcode/sql/1757.recyclable-and-low-fat-products)
* [1767.(Hard)Find the Subtasks That Did Not Execute](https://zqt0.gitbook.io/leetcode/sql/1767.find-the-subtasks-that-did-not-execute)
* [1777.(Easy)每家商店的产品价格](https://zqt0.gitbook.io/leetcode/sql/1777.products-price-for-each-store)
* [1783.(Medium)Grand Slam Titles](https://zqt0.gitbook.io/leetcode/sql/1783.grand-slam-titles)
* [1789.(Easy)Primary Department for Each Employee](https://zqt0.gitbook.io/leetcode/sql/1789.primary-department-for-each-employee)
* [1795.(Easy)Rearrange Products Table](https://zqt0.gitbook.io/leetcode/sql/1795.rearrange-products-table)
* [1809.(Easy)Ad-Free Sessions](https://zqt0.gitbook.io/leetcode/sql/1809.ad-free-sessions)
* [1811.(Medium)Find Interview Candidates](https://zqt0.gitbook.io/leetcode/sql/1811.find-interview-candidates)
* [1821.(Easy)Find Customers With Positive Revenue this Year](https://zqt0.gitbook.io/leetcode/sql/1821.find-customers-with-positive-revenue-this-year)
* [1831.(Medium)Maximum Transaction Each Day](https://zqt0.gitbook.io/leetcode/sql/1831.maximum-transaction-each-day)
* [1841.(Medium)League Statistics](https://zqt0.gitbook.io/leetcode/sql/1841.league-statistics)
* [1843.(Medium)Suspicious Bank Accounts](https://zqt0.gitbook.io/leetcode/sql/1843.suspicious-bank-accounts)
* [1853.(Easy)Convert Date Format](https://zqt0.gitbook.io/leetcode/sql/1853.convert-date-format)
* [1867.(Medium)Orders With Maximum Quantity Above Average](https://zqt0.gitbook.io/leetcode/sql/1867.orders-with-maximum-quantity-above-average)
* [1873.(Easy)Calculate Special Bonus](https://zqt0.gitbook.io/leetcode/sql/1873.calculate-special-bonus)
* [1875.(Medium)Group Employees of the Same Salary](https://zqt0.gitbook.io/leetcode/sql/1875.group-employees-of-the-same-salary)
* [1890.(Easy)The Latest Login in 2020](https://zqt0.gitbook.io/leetcode/sql/1890.the-latest-login-in-2020)
* [1892.(Hard)Page Recommendations II](https://zqt0.gitbook.io/leetcode/sql/1892.page-recommendations-ii)
* [1907.(Medium)Count Salary Categories](https://zqt0.gitbook.io/leetcode/sql/1907.count-salary-categories)
* [1917.(Hard)Leetcodify Friends Recommendations](https://zqt0.gitbook.io/leetcode/sql/1917.leetcodify-friends-recommendations)
* [1919.(Hard)Leetcodify Similar Friends](https://zqt0.gitbook.io/leetcode/sql/1919.leetcodify-similar-friends)
* [1934.(Medium)Confirmation Rate](https://zqt0.gitbook.io/leetcode/sql/1934.confirmation-rate)
* [1939.(Easy)Users That Actively Request Confirmation Messages](https://zqt0.gitbook.io/leetcode/sql/1939.users-that-actively-request-confirmation-messages)
