- Notifications
You must be signed in to change notification settings - Fork88
Improved tasks 175-184#1982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
12 changes: 10 additions & 2 deletionssrc/main/java/g0101_0200/s0175_combine_two_tables/script.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
# Write your MySQL query statement below | ||
# #Easy #Database #SQL_I_Day_5_Union #2022_06_26_Time_491_ms_(32.30%)_Space_0B_(100.00%) | ||
SELECT | ||
FirstName, | ||
LastName, | ||
City, | ||
State | ||
FROM | ||
Person | ||
LEFT JOIN | ||
Address | ||
USING (PersonId); |
16 changes: 10 additions & 6 deletionssrc/main/java/g0101_0200/s0176_second_highest_salary/script.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
# Write your MySQL query statement below | ||
# #Medium #Database #SQL_I_Day_4_Union_and_Select | ||
# #2022_07_10_Time_225_ms_(73.10%)_Space_0B_(100.00%) | ||
SELECT | ||
IFNULL( | ||
( | ||
SELECT DISTINCT Salary | ||
FROM Employee | ||
ORDER BY Salary DESC | ||
LIMIT 1 OFFSET 1 | ||
), | ||
NULL | ||
) AS SecondHighestSalary; |
9 changes: 8 additions & 1 deletionsrc/main/java/g0101_0200/s0178_rank_scores/script.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
# Write your MySQL query statement below | ||
# #Medium #Database #2022_06_26_Time_290_ms_(66.73%)_Space_0B_(100.00%) | ||
SELECT | ||
Score, | ||
DENSE_RANK() OVER (ORDER BY Score DESC) AS Rank | ||
FROM | ||
Scores | ||
ORDER BY | ||
Rank ASC; | ||
14 changes: 9 additions & 5 deletionssrc/main/java/g0101_0200/s0180_consecutive_numbers/script.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
# Write your MySQL query statement below | ||
# #Medium #Database #2024_07_15_Time_469_ms_(89.19%)_Space_0B_(100.00%) | ||
SELECT DISTINCT | ||
l1.num AS ConsecutiveNums | ||
FROM | ||
Logs l1 | ||
JOIN Logs l2 ON l1.id = l2.id - 1 | ||
JOIN Logs l3 ON l1.id = l3.id - 2 | ||
WHERE | ||
l1.num = l2.num | ||
AND l2.num = l3.num; |
10 changes: 8 additions & 2 deletionssrc/main/java/g0101_0200/s0181_employees_earning_more_than_their_managers/script.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
# Write your MySQL query statement below | ||
# #Easy #Database #2022_06_27_Time_315_ms_(94.44%)_Space_0B_(100.00%) | ||
SELECT | ||
a.Name AS Employee | ||
FROM | ||
Employee a | ||
LEFT JOIN Employee b ON a.ManagerId = b.Id | ||
WHERE | ||
a.Salary > b.Salary | ||
AND a.ManagerId IS NOT NULL; |
10 changes: 9 additions & 1 deletionsrc/main/java/g0101_0200/s0182_duplicate_emails/script.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
# Write your MySQL query statement below | ||
# #Easy #Database #SQL_I_Day_10_Where #2022_06_27_Time_303_ms_(92.08%)_Space_0B_(100.00%) | ||
SELECT | ||
FROM | ||
Person | ||
GROUP BY | ||
HAVING | ||
COUNT(Email) > 1; | ||
12 changes: 7 additions & 5 deletionssrc/main/java/g0101_0200/s0183_customers_who_never_order/script.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# Write your MySQL query statement below | ||
# #Easy #Database #SQL_I_Day_1_Select #2022_06_27_Time_376_ms_(98.73%)_Space_0B_(100.00%) | ||
SELECT | ||
c.Name AS Customers | ||
FROM | ||
Customers AS c | ||
LEFT JOIN Orders AS o ON c.Id = o.CustomerId | ||
WHERE | ||
o.CustomerId IS NULL; |
25 changes: 15 additions & 10 deletionssrc/main/java/g0101_0200/s0184_department_highest_salary/script.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.