MySQL, MS SQL and Oracle solution with explanations
We may have 4 cases here:\n1) product has no any sales\n2) product sold in the spring of 2019 only\n3) product sold in other periods, but not in the spring of 2
We may have 4 cases here:\n1) product has no any sales\n2) product sold in the spring of 2019 only\n3) product sold in other periods, but not in the spring of 2019\n4) product sold in the spring of 2019 and in other periods\n\nThe 2nd case only is correct for the task condition (**only sold in the spring of 2019, between 2019-01-01 and 2019-03-31 inclusive**)\n\nAt the first we have to extract all lines from sales and join them with products, group them by product id and name (the 1st case goes away).\n\nWe may calculate count of sale lines that out of the spring 2019 period:\n```SUM(CASE WHEN sale_date BETWEEN \'2019-01-01\' AND \'2019-03-31\' THEN 0 ELSE 1 END)```\nIf this sum is 0, it means that all sales of this product belong to the spring 2019 period (3rd and 4th cases went away)\n\nFinally we have the solution:\n\n\n```\nSELECT\n    p.product_id,\n    p.product_name\nFROM Sales s\nINNER JOIN Product p ON s.product_id = p.product_id\nGROUP BY\n    p.product_id,\n    p.product_name\nHAVING\n    SUM(CASE WHEN sale_date BETWEEN \'2019-01-01\' AND \'2019-03-31\' THEN 0 ELSE 1 END) = 0\n```
['MySQL', 'Oracle', 'MS SQL Server']