To see all of the sources available to query, go to the data warehouse tab. This page shows all the external and PostHog tables you can query through SQL insights along with saved views. Click on any of the tables, and then click "Query" to open an SQL insight.


Querying sources
To start with querying your sources:
- Choose a table and click "Query" or create a new SQL insight.
- If you didn't already, choose a table to query FROMlikestripe_chargeorhubspot_contacts
- Write your SQL query using your table like SELECT * FROM hubspot_contacts
- Click "Update and run" to see the results.
- Modify your query using SQL commands as needed to get the data you want like SELECT email FROM hubspot_contacts WHERE city = 'Brisbane'.
- Save your query.


Combining data sources
Much of the power of the data warehouse comes from combining multiple sources, like your Stripe or Hubspot data with your product analytics data. Two of the easiest ways of doing this are WHERE IN and JOIN SQL commands.
For example, to get a count of events for your Hubspot contacts you can filter events.distinct_id by email FROM hubspot_contacts like this:
You can also use a JOIN such as INNER JOIN or LEFT JOIN to combine data. For example, to get a count of events for your Stripe customers you can INNER JOIN on distinct_id and email like this: