you should use left join instead of right join
Various associations
inner join : keep only rows where there is data in both tables
left join : save all rows of the left table and add what is possible on the right side
right join : save all rows of the right table and add what is possible on the left side
The left table is always the table that we already have, and the right table is the one we are connecting to.
There is also a cross join for the record, which joins each row in the left table with each row in the right table, but this one is not used very often.
I hope now all this will become clearer for you :)
Corrected Request
select bird_name, member_id from birds left join bird_likes on birds.bird_id = bird_likes.bird_id where member_id = 2;
Remember that this assumes that the member_id column is in the bird table, otherwise you can save the condition as follows:
select bird_name, member_id from birds left join bird_likes on birds.bird_id = bird_likes.bird_id and bird_likes.member_id = 2;
krtek source share