# G2 schema ERD

Table and field reference for the Fivetran G2 connector.

## Table & Field Reference

### track_prospect

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| external_id | String |  |
| first_seen_occurred_at | Instant |  |
| first_seen_path | String |  |
| first_seen_scope | String |  |
| industry | String |  |
| isp | Boolean |  |
| last_seen_occurred_at | Instant |  |
| last_seen_path | String |  |
| last_seen_scope | String |  |
| organization | String |  |
| saw_first | String |  |
| visitor_id | String |  |

### answer

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| product_id | String | FK |
| question_id | String | FK |
| survey_response_id | Long | FK |
| created_at | Instant |  |
| input_type | String |  |
| question_text | String |  |
| question_type | String |  |
| updated_at | Instant |  |
| value | String |  |

### resource_subscription

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| product_uuid | String | FK |
| post_url | String |  |
| product_id | String |  |
| subscribed_resource | String |  |
| updated_at | Instant |  |

### vendor_product

| Column | Type | Keys |
| --- | --- | --- |
| product_id | String | PK, FK |
| vendor_id | String | PK, FK |

### question

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| survey_response_id | Long | FK |
| description | String |  |
| input_type | String |  |
| is_required | Boolean |  |
| question_type | String |  |
| text_template | String |  |
| title | String |  |

### company

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| event_stream_id | Long | FK |
| external_id | String | FK |
| alexa_global_rank | Long |  |
| alexa_us_rank | Long |  |
| annual_revenue | String |  |
| city | String |  |
| company_type | String |  |
| country | String |  |
| country_code | String |  |
| crunchbase | String |  |
| description | String |  |
| domain | String |  |
| domain_aliases | Json |  |
| email_provider | String |  |
| employees | Long |  |
| employees_range | String |  |
| founded_year | Long |  |
| latitude | String |  |
| legal_name | String |  |
| linkedin | String |  |
| location | String |  |
| longitude | String |  |
| market_cap | String |  |
| name | String |  |
| postal_code | String |  |
| raised | String |  |
| site_author | String |  |
| site_h_1 | String |  |
| site_meta | String |  |
| site_title | String |  |
| state | String |  |
| state_code | String |  |
| street_name | String |  |
| street_number | String |  |
| sub_premise | String |  |
| tags | Json |  |
| tech | Json |  |
| time_zone | String |  |
| twitter | String |  |
| twitter_avatar | String |  |
| twitter_bio | String |  |
| twitter_followers | Long |  |
| twitter_following | Long |  |
| twitter_id | String |  |
| twitter_location | String |  |
| twitter_site | String |  |
| url | String |  |
| utc_offset | Long |  |

### event_stream

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| visitor_id | String | FK |
| category_ids | Json |  |
| city | String |  |
| country | String |  |
| country_code | String |  |
| created_at | Instant |  |
| organization | String |  |
| product_ids | Json |  |
| state | String |  |
| state_code | String |  |
| tags | String |  |
| time | Instant |  |
| title | String |  |
| url | String |  |

### product_rating

| Column | Type | Keys |
| --- | --- | --- |
| product_id | String | PK, FK |
| main_category_id | String | FK |
| category_average_ease_of_setup | Double |  |
| category_average_ease_of_use | Double |  |
| category_average_quality_of_support | Double |  |
| category_name | String |  |
| product_average_ease_of_setup | Double |  |
| product_average_ease_of_use | Double |  |
| product_average_quality_of_support | Double |  |

### product_feature

| Column | Type | Keys |
| --- | --- | --- |
| product_feature_id | Long | PK |
| product_id | String | FK |
| question_id | Long | FK |
| available | Boolean |  |
| description | String |  |
| percentage | Double |  |
| review_count | Long |  |
| section_title | String |  |
| text | String |  |

### product

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| avg_rating | Double |  |
| created_at | Instant |  |
| description | String |  |
| detail_description | String |  |
| domain | String |  |
| image_url | String |  |
| name | String |  |
| product_type | String |  |
| product_url | String |  |
| public_detail_url | String |  |
| review_count | Long |  |
| short_name | String |  |
| slug | String |  |
| star_rating | Double |  |
| updated_at | Instant |  |

### category

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| description | String |  |
| name | String |  |
| slug | String |  |
| updated_at | Instant |  |

### product_category

| Column | Type | Keys |
| --- | --- | --- |
| category_id | String | PK, FK |
| product_id | String | PK, FK |

### vendor

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| company_website | String |  |
| description | String |  |
| name | String |  |
| public_product_count | Long |  |
| slug | String |  |
| updated_at | Instant |  |

### product_competitor

| Column | Type | Keys |
| --- | --- | --- |
| competitor_id | String | PK, FK |
| product_id | String | FK |

### survey_response

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| product_id | String | FK |
| country_name | String |  |
| default_sort | Double |  |
| ease_of_doing_business_with_text | String |  |
| ease_of_doing_business_with_value | Double |  |
| ease_of_setup_text | String |  |
| ease_of_setup_value | Double |  |
| hate_text | String |  |
| hate_value | String |  |
| is_business_partner | Boolean |  |
| is_public | Boolean |  |
| love_text | String |  |
| love_value | String |  |
| meet_requirement_text | String |  |
| meet_requirement_value | Double |  |
| moderated_at | Instant |  |
| percent_complete | Double |  |
| product_name | String |  |
| recommendation_text | String |  |
| recommendation_value | String |  |
| reference_user_consent | String |  |
| regions | Json |  |
| review_source | String |  |
| slug | String |  |
| star_rating | Double |  |
| status | String |  |
| submitted_at | Instant |  |
| title | String |  |
| updated_at | Instant |  |
| user_id | String |  |
| user_image_url | String |  |
| user_name | String |  |
| verified_current_user | Boolean |  |
| votes_down | Long |  |
| votes_total | Long |  |
| votes_up | Long |  |

### history_compared_product

| Column | Type | Keys |
| --- | --- | --- |
| history_id | Long | PK, FK |
| product_id | String | PK, FK |
| product_name | String |  |

### history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| category_pageview | Long |  |
| company_country | String |  |
| company_domain | String |  |
| company_name | String |  |
| company_state | String |  |
| comparison_pageview | Long |  |
| competitor_pageview | Long |  |
| direct_pageview | Long |  |
| intent_score | Long |  |
| last_seen_at | Instant |  |
| product_profile_pageview | Long |  |
| sponsored_content_pageview | Long |  |
| total_pageview | Long |  |
| visitor_count | Long |  |

## Relationships

- answer(question_id) → question(id)
- answer(product_id) → product(id)
- answer(survey_response_id) → survey_response(id)
- resource_subscription(product_uuid) → product(id)
- vendor_product(product_id) → product(id)
- vendor_product(vendor_id) → vendor(id)
- question(survey_response_id) → survey_response(id)
- company(external_id) → track_prospect(id)
- company(event_stream_id) → event_stream(id)
- event_stream(visitor_id) → track_prospect(id)
- product_rating(product_id) → product(id)
- product_rating(main_category_id) → category(id)
- product_feature(question_id) → question(id)
- product_feature(product_id) → product(id)
- product_category(product_id) → product(id)
- product_category(category_id) → category(id)
- product_competitor(competitor_id) → product(id)
- product_competitor(product_id) → product(id)
- survey_response(product_id) → product(id)
- history_compared_product(product_id) → product(id)
- history_compared_product(history_id) → history(id)
