Summary of Leetcode-Mysql topics and knowledge points (577. Bonuses for employees)

Computer Xiaobai QAQ, because I want to find a few summer internships, I have filled the members and want to focus on the mysql part of leetcode. Write this series of blog posts to communicate with you, and we will continue to update some of the prepared questions in the future. Welcome to communicate with you, and ask the big guys to spray QAQ. Because I have taken many detours as a beginner, I will try my best to write in detail. If you can help future friends, please leave a message to encourage me. Hahahaha.

577. Staff bonus

Idea: Connect the two tables to the left and filter by conditions. Note that the part without bonus will be displayed as null in the connected table.

There is no new knowledge point, mainly using left connection and judging the usage of null value is null

Code:

select name,bonus

from Employee left join bonus ON Employee.empid=bonus.empid

where bonus<1000 or bonus is null

 

 

Guess you like

Origin blog.csdn.net/weixin_43167461/article/details/113186816