[leetcode][Database][Hard] 1412. Find the Quiet Students in All Exams

Description Table: Student +---------------------+---------+ | Column Name | Type | +---------------------+---------+ | student_id | int | | student_name | varchar | +---------------------+---------+ student_id is the primary key for this table. student_name is the name of the student. Table: Exam +---------------+---------+ | Column Name | Type | +---------------+---------+ | exam_id | int | | student_id | int | | score | int | +---------------+---------+ (exam_id, student_id) is the primary key for this table....

<span title='2022-12-13 01:08:00.986 +0000 UTC'>December 13, 2022</span>&nbsp;·&nbsp;3 分鐘&nbsp;·&nbsp;519 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 1369. Get the Second Most Recent Activity

Description Table: UserActivity +---------------+---------+ | Column Name | Type | +---------------+---------+ | username | varchar | | activity | varchar | | startDate | Date | | endDate | Date | +---------------+---------+ There is no primary key for this table. It may contain duplicates. This table contains information about the activity performed by each user in a period of time. A person with username performed an activity from startDate to endDate....

<span title='2022-12-13 00:10:04.002 +0000 UTC'>December 13, 2022</span>&nbsp;·&nbsp;2 分鐘&nbsp;·&nbsp;410 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 1336. Number of Transactions per Visit

Description Table: Visits +---------------+---------+ | Column Name | Type | +---------------+---------+ | user_id | int | | visit_date | date | +---------------+---------+ (user_id, visit_date) is the primary key for this table. Each row of this table indicates that user_id has visited the bank in visit_date. Table: Transactions +------------------+---------+ | Column Name | Type | +------------------+---------+ | user_id | int | | transaction_date | date | | amount | int | +------------------+---------+ There is no primary key for this table, it may contain duplicates....

<span title='2022-12-12 16:38:05.305 +0000 UTC'>December 12, 2022</span>&nbsp;·&nbsp;4 分鐘&nbsp;·&nbsp;717 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 1225. Report Contiguous Dates

題目 Table: Failed +--------------+---------+ | Column Name | Type | +--------------+---------+ | fail_date | date | +--------------+---------+ fail_date is the primary key for this table. This table contains the days of failed tasks. Table: Succeeded +--------------+---------+ | Column Name | Type | +--------------+---------+ | success_date | date | +--------------+---------+ success_date is the primary key for this table. This table contains the days of succeeded tasks. A system is running...

<span title='2022-12-07 02:38:30.546 +0000 UTC'>December 7, 2022</span>&nbsp;·&nbsp;3 分鐘&nbsp;·&nbsp;1077 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 185. Department Top Three Salaries

題目 Table: Employee +--------------+---------+ | Column Name | Type | +--------------+---------+ | id | int | | name | varchar | | salary | int | | departmentId | int | +--------------+---------+ id is the primary key column for this table. departmentId is a foreign key of the ID from the Department table. Each row of this table indicates the ID, name, and salary of an employee. It also...

<span title='2022-12-06 17:21:44.783 +0000 UTC'>December 6, 2022</span>&nbsp;·&nbsp;2 分鐘&nbsp;·&nbsp;677 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 262. Trips and Users

題目 Table: Trips +-------------+----------+ | Column Name | Type | +-------------+----------+ | id | int | | client_id | int | | driver_id | int | | city_id | int | | status | enum | | request_at | date | +-------------+----------+ id is the primary key for this table. The table holds all taxi trips. Each trip has a unique id, while client_id and driver_id are foreign keys...

<span title='2022-12-06 17:08:27.973 +0000 UTC'>December 6, 2022</span>&nbsp;·&nbsp;2 分鐘&nbsp;·&nbsp;836 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 569. Median Employee Salary

題目 Table: Employee +--------------+---------+ | Column Name | Type | +--------------+---------+ | id | int | | company | varchar | | salary | int | +--------------+---------+ id is the primary key column for this table. Each row of this table indicates the company and the salary of one employee. Write an SQL query to find the rows that contain the median salary of each company. While calculating the...

<span title='2022-12-06 16:48:49.861 +0000 UTC'>December 6, 2022</span>&nbsp;·&nbsp;2 分鐘&nbsp;·&nbsp;502 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 571. Find Median Given Frequency of Numbers

題目 Table: Numbers +-------------+------+ | Column Name | Type | +-------------+------+ | num | int | | frequency | int | +-------------+------+ num is the primary key for this table. Each row of this table shows the frequency of a number in the database. The median is the value separating the higher half from the lower half of a data sample. Write an SQL query to report the median...

<span title='2022-12-06 16:31:02.761 +0000 UTC'>December 6, 2022</span>&nbsp;·&nbsp;2 分鐘&nbsp;·&nbsp;646 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 579. Find Cumulative Salary of an Employee

題目 Table: Employee +-------------+------+ | Column Name | Type | +-------------+------+ | id | int | | month | int | | salary | int | +-------------+------+ (id, month) is the primary key for this table. Each row in the table indicates the salary of an employee in one month during the year 2020. Write an SQL query to calculate the cumulative salary summary for every employee in a...

<span title='2022-12-06 15:18:29.163 +0000 UTC'>December 6, 2022</span>&nbsp;·&nbsp;2 分鐘&nbsp;·&nbsp;786 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 601. Human Traffic of Stadium

題目 Table: Stadium +---------------+---------+ | Column Name | Type | +---------------+---------+ | id | int | | visit_date | date | | people | int | +---------------+---------+ visit_date is the primary key for this table. Each row of this table contains the visit date and visit id to the stadium with the number of people during the visit. No two rows will have the same visit_date, and as the...

<span title='2022-12-06 14:55:01.53 +0000 UTC'>December 6, 2022</span>&nbsp;·&nbsp;2 分鐘&nbsp;·&nbsp;741 字&nbsp;·&nbsp;ZhengWei, Liu