LeetCode Database Solutions [Easy] 004 | Eugene Tsai
Introduction
This is the fourth article about the solutions of easy level database questions on LeetCode. As always, just a quick reminder, if you are a new reader about this topic, I am writing this article because I am practicing SQL queries recently, and I decide to note it down not only for personal future review, but also for people who are just new in this field. This is a serial article, thus, the links below are here to get you started, and do not forget to follow me, and click a clap in case missing any new articles.
LeetCode Database Questions
- No 595. Big Countries
- No 596. Classes More Than 5 Students
- No 607. Sales Person
Let’s get moving
No 595. Big Countries
Table: World
Question:
MySQL Solutions:
Approach I:
Approach II:
No 596. Classes More Than 5 Students
Table: Courses
Question:
MySQL Solutions:
Approach I:
Approach II:
No 607. Sales Person
Table: SalesPerson
Table: Company
Table: Orders
Question:
MySQL Solutions:
Approach I:
Approach II:
Conclusion
This is all for today. Above are the solutions of the three easy level database questions on LeetCode. There are still tons of SQL queries to solve these questions. Therefore, if you can come up with different or more efficient solutions, please be free to tell me or connect me on my LinkedIn for further discussion. Last, do not forget to follow me, and click a clap for me. Thank you for your time!