Products With Three or More Orders in Two Consecutive Years
[]
['Create table If Not Exists Orders (order_id int, product_id int, quantity int, purchase_date date)', 'Truncate table Orders', "insert into Orders (order_id, product_id, quantity, purchase_date) values ('1', '1', '7', '2020-03-16')", "insert into Orders (order_id, product_id, quantity, purchase_date) values ('2', '1', '4', '2020-12-02')", "insert into Orders (order_id, product_id, quantity, purchase_date) values ('3', '1', '7', '2020-05-10')", "insert into Orders (order_id, product_id, quantity, purchase_date) values ('4', '1', '6', '2021-12-23')", "insert into Orders (order_id, product_id, quantity, purchase_date) values ('5', '1', '5', '2021-05-21')", "insert into Orders (order_id, product_id, quantity, purchase_date) values ('6', '1', '6', '2021-10-11')", "insert into Orders (order_id, product_id, quantity, purchase_date) values ('7', '2', '6', '2022-10-11')"]
{"mysql": ["Create table If Not Exists Orders (order_id int, product_id int, quantity int, purchase_date date)"], "mssql": ["Create table Orders (order_id int, product_id int, quantity int, purchase_date date)"], "oraclesql": ["Create table Orders (order_id int, product_id int, quantity int, purchase_date date)", "ALTER SESSION SET nls_date_format='YYYY-MM-DD'"], "database": true, "name": "find_valid_products", "pythondata": ["Orders = pd.DataFrame([], columns=['order_id', 'product_id', 'quantity', 'purchase_date']).astype({'order_id':'Int64', 'product_id':'Int64', 'quantity':'Int64', 'purchase_date':'datetime64[ns]'})"], "postgresql": ["Create table If Not Exists Orders (order_id int, product_id int, quantity int, purchase_date date)"], "database_schema": {"Orders": {"order_id": "INT", "product_id": "INT", "quantity": "INT", "purchase_date": "DATE"}}}
{"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16</p>"]}
['Database']