"content":"<p>Table: <code>Users</code></p>\n\n<pre>\n+----------------+---------+\n| Column Name | Type |\n+----------------+---------+\n| user_id | int |\n| join_date | date |\n| favorite_brand | varchar |\n+----------------+---------+\nuser_id is the primary key (column with unique values) of this table.\nThis table has the info of the users of an online shopping website where users can sell and buy items.\n</pre>\n\n<p> </p>\n\n<p>Table: <code>Orders</code></p>\n\n<pre>\n+---------------+---------+\n| Column Name | Type |\n+---------------+---------+\n| order_id | int |\n| order_date | date |\n| item_id | int |\n| buyer_id | int |\n| seller_id | int |\n+---------------+---------+\norder_id is the primary key (column with unique values) of this table.\nitem_id is a foreign key (reference column) to the Items table.\nbuyer_id and seller_id are foreign keys to the Users table.\n</pre>\n\n<p> </p>\n\n<p>Table: <code>Items</code></p>\n\n<pre>\n+---------------+---------+\n| Column Name | Type |\n+---------------+---------+\n| item_id | int |\n| item_brand | varchar |\n+---------------+---------+\nitem_id is the primary key (column with unique values) of this table.\n</pre>\n\n<p> </p>\n\n<p>Write a solution to find for each user, the join date and the number of orders they made as a buyer in <code>2019</code>.</p>\n\n<p>Return the result table in <strong>any order</strong>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nUsers table:\n+---------+------------+----------------+\n| user_id | join_date | favorite_brand |\n+---------+------------+----------------+\n| 1 | 2018-01-01 | Lenovo |\n| 2 | 2018-02-09 | Samsung |\n| 3 | 2018-01-19 | LG |\n| 4 | 2018-05-21 | HP |\n+---------+------------+----------------+\nOrders table:\n+----------+------------+---------+----------+-----------+\n| order_id | order_date | item_id | buyer_id | seller_id |\n+----------+------------+---------+----------+-----------+\n| 1 | 2019-08-01 | 4 | 1 | 2 |\n| 2 | 2018-08-02 | 2 | 1 | 3 |\n| 3 | 2019-08-03 | 3 | 2 | 3 |\n| 4 | 2018-08-04 | 1 | 4 | 2 |\n| 5 | 2018-08-04 | 1 | 3 | 4 |\n| 6 | 2019-08-05 | 2 | 2 | 4 |\n+----------+------------+---------+----------+-----------+\nItems table:\n+---------+------------+\n| item_id | item_brand |\n+---------+------------+\n| 1 | Samsung |\n| 2 | Lenovo |\n| 3 | LG |\n| 4 | HP |\n+---------+------------+\n<strong>Output:</strong> \n+-----------+------------+----------------+\n| buyer_id | join_date | orders_in_2019 |\n+-----------+------------+----------------+\n| 1 | 2018-01-01 | 1 |\n| 2 | 2018-02-09 | 2 |\n| 3 | 2018-01-19 | 0 |\n| 4 | 2018-05-21 | 0 |\n+-----------+------------+----------------+\n</pre>\n",