easy solution | sql
~~~\nselect product.product_id,product_name from product\njoin sales on product.product_id=sales.product_id\ngroup by product.product_id\nhaving max(sale_date) 
~~~\nselect product.product_id,product_name from product\njoin sales on product.product_id=sales.product_id\ngroup by product.product_id\nhaving max(sale_date) <= "2019-03-31" and min(sale_date)>= "2019-01-01"\n~~~\n
[]