SIMPLE MSOLUTION WITH NOT EXISTS ( SQL SERVER + MYSQL )
Intuition\r\n Describe your first thoughts on how to solve this problem. \r\n\r\n# Approach\r\n Describe your approach to solving the problem. \r\n\r\n# Complex
# Intuition\r\n<!-- Describe your first thoughts on how to solve this problem. -->\r\n\r\n# Approach\r\n<!-- Describe your approach to solving the problem. -->\r\n\r\n# Complexity\r\n- Time complexity:\r\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\r\n\r\n- Space complexity:\r\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\r\n\r\n# Code\r\n```\r\n/* Write your T-SQL query statement below */\r\n\r\nSELECT\r\nDISTINCT\r\n    P.product_id,\r\n    P.product_name\r\nFROM\r\n    Product P\r\nINNER JOIN\r\n    Sales S ON P.product_id = S.product_id\r\nAND\r\n    NOT EXISTS\r\n        (\r\n            SELECT\r\n                1\r\n            FROM\r\n                Sales SS\r\n            WHERE\r\n                SS.product_id = S.product_id\r\n            AND\r\n               (SS.sale_date < \'2019-01-01\' OR SS.sale_date > \'2019-03-31\') \r\n        )\r\n\r\n\r\n\r\n```
['MySQL', 'MS SQL Server']