Customer Who Visited but Did Not Make Any Transactions
<p>Table: <code>Visits</code></p>

<pre>
+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| visit_id    | int     |
| customer_id | int     |
+-------------+---------+
visit_id is the column with unique values for this table.
This table contains information about the customers who visited the mall.
</pre>

<p>&nbsp;</p>

<p>Table: <code>Transactions</code></p>

<pre>
+----------------+---------+
| Column Name    | Type    |
+----------------+---------+
| transaction_id | int     |
| visit_id       | int     |
| amount         | int     |
+----------------+---------+
transaction_id is column with unique values for this table.
This table contains information about the transactions made during the visit_id.
</pre>

<p>&nbsp;</p>

<p>Write a&nbsp;solution to find the IDs of the users who visited without making any transactions and the number of times they made these types of visits.</p>

<p>Return the result table sorted in <strong>any order</strong>.</p>

<p>The&nbsp;result format is in the following example.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> 
Visits
+----------+-------------+
| visit_id | customer_id |
+----------+-------------+
| 1        | 23          |
| 2        | 9           |
| 4        | 30          |
| 5        | 54          |
| 6        | 96          |
| 7        | 54          |
| 8        | 54          |
+----------+-------------+
Transactions
+----------------+----------+--------+
| transaction_id | visit_id | amount |
+----------------+----------+--------+
| 2              | 5        | 310    |
| 3              | 5        | 300    |
| 9              | 5        | 200    |
| 12             | 1        | 910    |
| 13             | 2        | 970    |
+----------------+----------+--------+
<strong>Output:</strong> 
+-------------+----------------+
| customer_id | count_no_trans |
+-------------+----------------+
| 54          | 2              |
| 30          | 1              |
| 96          | 1              |
+-------------+----------------+
<strong>Explanation:</strong> 
Customer with id = 23 visited the mall once and made one transaction during the visit with id = 12.
Customer with id = 9 visited the mall once and made one transaction during the visit with id = 13.
Customer with id = 30 visited the mall once and did not make any transactions.
Customer with id = 54 visited the mall three times. During 2 visits they did not make any transactions, and during one visit they made 3 transactions.
Customer with id = 96 visited the mall once and did not make any transactions.
As we can see, users with IDs 30 and 96 visited the mall one time without making any transactions. Also, user 54 visited the mall twice and did not make any transactions.
</pre>

['sellers-with-no-sales']
['Create table If Not Exists Visits(visit_id int, customer_id int)', 'Create table If Not Exists Transactions(transaction_id int, visit_id int, amount int)', 'Truncate table Visits', "insert into Visits (visit_id, customer_id) values ('1', '23')", "insert into Visits (visit_id, customer_id) values ('2', '9')", "insert into Visits (visit_id, customer_id) values ('4', '30')", "insert into Visits (visit_id, customer_id) values ('5', '54')", "insert into Visits (visit_id, customer_id) values ('6', '96')", "insert into Visits (visit_id, customer_id) values ('7', '54')", "insert into Visits (visit_id, customer_id) values ('8', '54')", 'Truncate table Transactions', "insert into Transactions (transaction_id, visit_id, amount) values ('2', '5', '310')", "insert into Transactions (transaction_id, visit_id, amount) values ('3', '5', '300')", "insert into Transactions (transaction_id, visit_id, amount) values ('9', '5', '200')", "insert into Transactions (transaction_id, visit_id, amount) values ('12', '1', '910')", "insert into Transactions (transaction_id, visit_id, amount) values ('13', '2', '970')"]
[{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"value": "pythondata", "text": "Pandas", "defaultCode": "import pandas as pd\n\ndef find_customers(visits: pd.DataFrame, transactions: pd.DataFrame) -> pd.DataFrame:\n    "}, {"value": "postgresql", "text": "PostgreSQL", "defaultCode": "-- Write your PostgreSQL query statement below\n"}]
{"mysql": ["Create table If Not Exists Visits(visit_id int, customer_id int)", "Create table If Not Exists Transactions(transaction_id int, visit_id int, amount int)"], "mssql": ["Create table Visits(visit_id int, customer_id int)", "Create table Transactions(transaction_id int, visit_id int, amount int)"], "oraclesql": ["Create table Visits(visit_id int, customer_id int)", "Create table Transactions(transaction_id int, visit_id int, amount int)"], "database": true, "name": "find_customers", "pythondata": ["Visits = pd.DataFrame([], columns=['visit_id', 'customer_id']).astype({'visit_id':'Int64', 'customer_id':'Int64'})", "Transactions = pd.DataFrame([], columns=['transaction_id', 'visit_id', 'amount']).astype({'transaction_id':'Int64', 'visit_id':'Int64', 'amount':'Int64'})\n"], "postgresql": ["\nCreate table If Not Exists Visits(visit_id int, customer_id int)\n", "Create table If Not Exists Transactions(transaction_id int, visit_id int, amount int)"], "database_schema": {"Visits": {"visit_id": "INT", "customer_id": "INT"}, "Transactions": {"transaction_id": "INT", "visit_id": "INT", "amount": "INT"}}}
{"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']