I am using SQL for the first time and can't seem to figure out how can I convert this query into a join. I want to do so, because I read this: Join vs. sub-query
SELECT `bookings`.* FROM `bookings` WHERE `bookings`.`user_id` IN
(SELECT `users`.`id` FROM `users` WHERE `users`.`phone` = 9999999999)
I want to find only those bookings whose users belong in the user table with a given phone number.
I tried using a join, but I don't understand what the possible condition of join should be.
Thanks a lot!