LeetCode Database Solutions [Easy] 005 | Eugene Tsai

Eugene Tsai
3 min readJul 12, 2022

--

photo by Christopher Gower

Introduction

This is the fifth article about the solutions of easy level database questions on LeetCode. LeetCode is always a great platform for people who want to prepare for their technical interviews while searching for jobs. For people who are first here, just a quick reminder, I am writing articles regarding this topic not only for my personal future review, but also for people who are practicing SQL queries. As always, if you think these articles are helpful, do not hesitate to follow me, and click a clap for me!

LeetCode Database Questions

  1. No 620. Not Boring Movies
  2. No 627. Swap Salary
  3. No 1050. Actors and Directors Who Cooperated At Least Three Times

Let’s dig in

No 620. Not Boring Movies

Table: Cinema

Question:

MySQL Solutions:

Approach I:

Approach II:

No 627. Swap Salary

Table: Salary

Question:

MySQL Solutions:

Approach I:

Approach II:

No 1050. Actors and Directors Who Cooperated At Least Three Times

Table: ActorDirector

Question:

MySQL Solutions:

Approach I:

Approach II:

Conclusion

These are all the solutions I can come up with of these three easy level database questions on LeetCode. I know that there are still many alternative solutions of these questions. Therefore, if you can think up different or more efficient solutions, please be free to share with 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!

--

--