LeetCode Database Solutions [Easy] 001 | Eugene Tsai

Eugene Tsai
3 min readJun 23, 2022

--

photo by Carlos Muza

Introduction

LeetCode is an excellent platform for practicing coding and preparing for technical interviews. Recently, I was practicing SQL queries on LeetCode, and I am writing this article not only for the purpose of future review as well as record my progress, but also for people who are also a beginner level in SQL or expecting to pursue a career in analytic fields. This is a serial article, and I will write a new article regarding this topic routinely. Thus, do not forget to follow me, and click a clap so that you will not miss any new articles!

LeetCode Database Questions

  1. No 175. Combine Two Tables
  2. No 181. Employees Earning More Than Their Managers
  3. No 182. Duplicate Emails

Let’s get it started

No 175. Combine Two Tables

Table: Person

Table: Address

Question:

MySQL Solutions:

Approach I:

Approach II:

No 181. Employees Earning More Than Their Managers

Table: Employee

Question:

MySQL Solutions:

Approach I:

Approach II:

No 182. Duplicate Emails

Table: Person

Question:

MySQL Solutions:

Approach I:

Approach II:

Conclusion

That is it. These are the solutions of the three easy level database questions on LeetCode. Hope that this article will be helpful to you. As always, do not forget to follow me, and click a clap. Moreover, if you think that you have better or more efficient solutions about these questions, just be free to DM me or connect me on my LinkedIn, and have a discussion with me! Thank you for your reading!

--

--