Skip to content

Commit d282eff

Browse files
authored
Create employee-bonus.sql
1 parent fe5b13c commit d282eff

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

MySQL/employee-bonus.sql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Time: O(n) if hash join, O(nlogn) if merge join
2+
# Space: O(n)
3+
4+
# https://www.quora.com/What-is-time-complexity-of-Join-algorithm-in-Database
5+
6+
SELECT
7+
Employee.name, Bonus.bonus
8+
FROM
9+
Employee
10+
LEFT JOIN
11+
Bonus ON Employee.empid = Bonus.empid
12+
WHERE
13+
bonus < 1000 OR bonus IS NULL
14+
;

0 commit comments

Comments
 (0)