I'm total newbie and attempting to extract customer data from 3 tables (Logs, Offers and Enterprise). I'm trying to determine which customers are enterprise clients and which are not by joining Logs table to Enterprise Table. Those that don't have any info in the enterprise table are considered non-Enterprise. There is also add'l info that I'd like to capture from the Offers table.
However, when I join the three tables I only receive Log and Offer information from Enterprise Candidates. The ideal output would capture data from all customers and have the enterprise info to determine enterprise form non-enterprise. I know this is because I'm doing it wrong but would greatly appreciate any help. Should this be some type of inner join to have a more inclusive output? Example format below:
SELECT
logs.id
,logs.customer_id
,logs.fees
,logs.city
,offers.actual_fees
,enterprise.id
FROM
all_logs logs
join
enterprise_table_ids enterprise
on
enterprise.enterprise_owner_id = logs_customer_id
JOIN
offers_table offers
on
offers.id = logs_transcation_id
AND
logs.logs_transcation_id > 'October 1, 2018'
AND
offer.action = 'COMPLETED'