Problem Description –
Write an SQL query to find the IDs of the users who visited without making any transactions and the number of times they made these types of visits.
Return the result table sorted in any order.
The query result format is in the following example.
Problem Link – customer who visited
Difficulty Level – Easy
SELECT customer_id, COUNT(*) as count_no_trans FROM Visits WHERE visit_id NOT IN (SELECT DISTINCT visit_id FROM transactions) GROUP BY 1