# Write your MySQL query statement below
select u.user_id buyer_id, u.join_date, if(a.orders_in_2019 is not null,a.orders_in_2019,0) orders_in_2019 from Users u left join (
select buyer_id, count(distinct order_id) orders_in_2019 from Orders
where order_date>='2019-01-01' and order_date<='2019-12-31' group by buyer_id
) a on u.user_id=a.buyer_id