You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Industry codes**: HubSpot uses predefined industry values (e.g., `COMPUTER_SOFTWARE`, `BIOTECHNOLOGY`, `FINANCIAL_SERVICES`). See [HubSpot's industry list](https://knowledge.hubspot.com/properties/hubspots-default-company-properties#industry) for all valid options.
102
+
-**Deal stages**: Each HubSpot account has custom pipeline stages. Use the stage IDs from your account (e.g., `presentationscheduled`, `closedwon`, `closedlost`, or numeric IDs like `110382973`).
103
+
-**Email validation**: Contact email addresses must be valid email formats (e.g., `user@example.com`).
104
+
99
105
## Example Usage
100
106
101
107
### Basic Connection
@@ -126,13 +132,6 @@ PARAMETERS = {
126
132
SHOW TABLES FROM hubspot_datasource;
127
133
```
128
134
129
-
**Get Table Schema:**
130
-
```sql
131
-
DESCRIBE hubspot_datasource.companies;
132
-
DESCRIBE hubspot_datasource.contacts;
133
-
DESCRIBE hubspot_datasource.deals;
134
-
```
135
-
136
135
**Get Detailed Column Information:**
137
136
```sql
138
137
SELECT*FROMinformation_schema.columns
@@ -154,59 +153,29 @@ SELECT * FROM hubspot_datasource.contacts LIMIT 10;
154
153
SELECT*FROMhubspot_datasource.dealsLIMIT10;
155
154
```
156
155
157
-
**Advanced Filtering and Analytics:**
158
-
```sql
159
-
-- Companies by industry and location
160
-
SELECT name, industry, city, state
161
-
FROMhubspot_datasource.companies
162
-
WHERE industry IN ('Technology', 'Healthcare')
163
-
AND city ='San Francisco'
164
-
ORDER BY name;
165
-
166
-
-- Contact engagement analysis
167
-
SELECT
168
-
company,
169
-
COUNT(*) as contact_count,
170
-
STRING_AGG(email, ', ') as emails
171
-
FROMhubspot_datasource.contacts
172
-
WHERE company IS NOT NULL
173
-
GROUP BY company
174
-
ORDER BY contact_count DESC;
175
-
176
-
-- Sales pipeline analysis
177
-
SELECT
178
-
dealstage,
179
-
COUNT(*) as deal_count,
180
-
SUM(CAST(amount ASDECIMAL)) as total_value,
181
-
AVG(CAST(amount ASDECIMAL)) as avg_deal_size
182
-
FROMhubspot_datasource.deals
183
-
WHERE amount IS NOT NULL
184
-
GROUP BY dealstage
185
-
ORDER BY total_value DESC;
186
-
```
187
156
188
157
### Data Manipulation
189
158
190
159
**Creating Records:**
191
160
```sql
192
161
-- Create new company
193
162
INSERT INTOhubspot_datasource.companies (name, domain, industry, city, state)
0 commit comments