Task: equi-join-detect (source dataset: Auto-BI)

Your are given a database with related tables used for business intelligence analysis. Your task is to identify all key/foreign-key join relationships between the tables for this database. Recall that a join is a relationship between two tables, that allows rows from one table to be combined with rows from another, based on a set of common join columns.
 
 
No explanation needed. Please return all join relationships in the following JSON format:
{
  "joins": [
    {
      "from_table": "table-1",
      "from_column": "column-1",
      "to_table": "table-2",
      "to_column": "column-3"
    }, 
	...
  ]
}

Tables:

Table: Campaign Analytics
| Region                  | Country   | Product Category   |   Campaign ID | Campaign Name    | Qualification   |   Qualification Number | Response Status   |   Responses |   Cost |   Revenue |       ROI |   Lead Generation (%) |   Revenue Target | Campaign Tactic   | Customer Segment    | Status    |   Profit |   Marketing Cost |   Customer Segment Key | Date                    |
|:------------------------|:----------|:-------------------|--------------:|:-----------------|:----------------|-----------------------:|:------------------|------------:|-------:|----------:|----------:|----------------------:|-----------------:|:------------------|:--------------------|:----------|---------:|-----------------:|-----------------------:|:------------------------|
| North & Central America | USA       | Audio              |           132 | Cutting Edge     | Inquiries       |                      6 | Qualified         |          14 |  33541 |    175848 |  3.24278  |                    53 |           258740 | Social            | Gen X (60 – 80s)    | Inquiries |   142307 |            32776 |                      2 | 2017-07-01 00:00:00.000 |
| South America           | Brazil    | Audio              |           106 | Cutting Edge     | Inquiries       |                      6 | Accepted          |          36 |  16150 |    267223 | 14.5463   |                    24 |           148291 | Social            | Gen Y (80 – 2000s)  | Inquiries |   251073 |            69870 |                      3 | 2017-07-01 00:00:00.000 |
| Europe                  | Germany   | Automotive         |           137 | Cutting Edge     | Inquiries       |                      5 | Active            |          25 |  84184 |    331551 |  1.93841  |                    24 |           248353 | Social            | Gen Y (80 – 2000s)  | Inquiries |   247367 |            37978 |                      3 | 2017-07-01 00:00:00.000 |
| North & Central America | USA       | Electronics        |           139 | Cutting Edge     | Inquiries       |                      5 | Active            |          39 | 155652 |    330497 |  0.123307 |                    65 |           114597 | Social            | Gen Y (80 – 2000s)  | Inquiries |   174845 |           118524 |                      3 | 2017-07-01 00:00:00.000 |
| Europe                  | Italy     | Computers          |            12 | Cutting Edge     | Inquiries       |                      6 | Accepted          |          19 | 111367 |    267580 |  0.402687 |                    72 |           130645 | Social            | Gen Z (2000s - now) | Inquiries |   156213 |            65722 |                      4 | 2017-07-01 00:00:00.000 |
| South America           | Brazil    | Audio              |           141 | Be Unique        | Inquiries       |                      6 | Active            |          45 | 210868 |    367829 | -0.255643 |                    28 |            96322 | Email             | Gen Y (80 – 2000s)  | Awareness |   156961 |            19499 |                      3 | 2017-07-01 00:00:00.000 |
| Europe                  | Italy     | Automotive         |            63 | Cutting Edge     | Inquiries       |                      2 | Qualified         |          46 |  43061 |    201246 |  2.67351  |                    46 |           230146 | Email             | Gen X (60 – 80s)    | Awareness |   158185 |            43248 |                      2 | 2017-07-01 00:00:00.000 |
| North & Central America | USA       | Electronics        |           112 | Cutting Edge     | Inquiries       |                      5 | Accepted          |          22 | 155210 |    257516 | -0.340854 |                    80 |           324666 | Email             | Gen Z (2000s - now) | Awareness |   102306 |           118099 |                      4 | 2017-07-01 00:00:00.000 |
| Asia Pacific            | Korea     | Home Automation    |            94 | Be Unique        | Inquiries       |                      5 | Accepted          |          25 | 266118 |    173094 | -1.34956  |                    23 |           231710 | Email             | Gen X (60 – 80s)    | Awareness |   -93024 |            66980 |                      2 | 2017-07-01 00:00:00.000 |
| South America           | Mexico    | Electronics        |            82 | Seasonal Savings | Inquiries       |                      6 | Accepted          |          44 | 284376 |    212551 | -1.25257  |                    60 |           169609 | Email             | Gen Y (80 – 2000s)  | Awareness |   -71825 |            98974 |                      3 | 2017-07-01 00:00:00.000 |


Table: Customer Segment
|   Customer Segment Key  | Customer Segment        |
|------------------------:|:------------------------|
|                       1 | Baby Boomers (45 – 60s) |
|                       2 | Gen X (60 – 80s)        |
|                       3 | Gen Y (80 – 2000s)      |
|                       4 | Gen Z (2000s - now)     |


Table: DimDate
|   DateKey | DateValue               |   DayOfMonth |   DayOfYear |   Year |   MonthOfYear | MonthName   |   QuarterOfYear | QuarterName   | WeekEnding              |
|----------:|:------------------------|-------------:|------------:|-------:|--------------:|:------------|----------------:|:--------------|:------------------------|
|  20140701 | 2014-07-01 00:00:00.000 |            1 |         182 |   2014 |             7 | July        |               3 | Q3            | 2014-07-05 00:00:00.000 |
|  20140702 | 2014-07-02 00:00:00.000 |            2 |         183 |   2014 |             7 | July        |               3 | Q3            | 2014-07-05 00:00:00.000 |
|  20140703 | 2014-07-03 00:00:00.000 |            3 |         184 |   2014 |             7 | July        |               3 | Q3            | 2014-07-05 00:00:00.000 |
|  20140704 | 2014-07-04 00:00:00.000 |            4 |         185 |   2014 |             7 | July        |               3 | Q3            | 2014-07-05 00:00:00.000 |
|  20140705 | 2014-07-05 00:00:00.000 |            5 |         186 |   2014 |             7 | July        |               3 | Q3            | 2014-07-05 00:00:00.000 |
|  20140706 | 2014-07-06 00:00:00.000 |            6 |         187 |   2014 |             7 | July        |               3 | Q3            | 2014-07-12 00:00:00.000 |
|  20140707 | 2014-07-07 00:00:00.000 |            7 |         188 |   2014 |             7 | July        |               3 | Q3            | 2014-07-12 00:00:00.000 |
|  20140708 | 2014-07-08 00:00:00.000 |            8 |         189 |   2014 |             7 | July        |               3 | Q3            | 2014-07-12 00:00:00.000 |
|  20140709 | 2014-07-09 00:00:00.000 |            9 |         190 |   2014 |             7 | July        |               3 | Q3            | 2014-07-12 00:00:00.000 |
|  20140710 | 2014-07-10 00:00:00.000 |           10 |         191 |   2014 |             7 | July        |               3 | Q3            | 2014-07-12 00:00:00.000 |


Table: Email Analytics Target Revenue
| Campaign Name            |   Target Monthly Revenue |
|:-------------------------|-------------------------:|
| Enjoy the Moment         |                   200000 |
| Fall Winter Collection   |                   100000 |
| Fun with Colors          |                   170000 |
| Get Sporty               |                   100000 |
| Seasonal                 |                    70000 |
| Spring Summer Collection |                   200000 |


Table: Email Analytics
|   Recency |   History Segment ID | History Segment   |   History |   Men |   Women | Zip Code   |   Newbie | Channel   | Segment       |   Opens |   Clicks |   Revenue |   Category ID | Product Category   | Date                    | Campaign   | Region                    | Customer Segment        | Gender   | Email Status   |   Customer Segment Key |   Month |
|----------:|---------------------:|:------------------|----------:|------:|--------:|:-----------|---------:|:----------|:--------------|--------:|---------:|----------:|--------------:|:-------------------|:------------------------|:-----------|:--------------------------|:------------------------|:---------|:---------------|-----------------------:|--------:|
|         7 |                    1 | $0 - $100         |     33.5  |     1 |       0 | Surburban  |        0 | Web       | Mens E-Mail   |       0 |        0 |     83790 |             2 | Electronics        | 2017-03-01 00:00:00.000 | Get Sporty | North and Central America | Gen Y (80 – 2000s)      | Female   | Opens          |                      3 |       3 |
|         8 |                    5 | $500 - $750       |     67.4  |     1 |       0 | Surburban  |        0 | Web       | Mens E-Mail   |       0 |        0 |     47340 |             2 | Electronics        | 2017-03-01 00:00:00.000 | Get Sporty | South America             | Gen Y (80 – 2000s)      | Other    | Opens          |                      3 |       3 |
|        11 |                    1 | $0 - $100         |    223.39 |     1 |       0 | Rural      |        1 | Phone     | Womens E-Mail |       0 |        0 |     23190 |             4 | Computers          | 2017-03-01 00:00:00.000 | Summer Fun | Asia Pacific              | Gen X (60 – 80s)        | Female   | Opens          |                      2 |       3 |
|         2 |                    3 | $200 - $350       |     39.78 |     0 |       1 | Surburban  |        0 | Web       | Mens E-Mail   |       0 |        0 |     28530 |             3 | Home Automation    | 2017-03-02 00:00:00.000 | Be Unique  | South America             | Gen X (60 – 80s)        | Male     | Clicks         |                      2 |       3 |
|         9 |                    2 | $100 - $200       |     39.83 |     0 |       1 | Urban      |        1 | Phone     | Mens E-Mail   |       1 |        0 |     41550 |             3 | Home Automation    | 2017-03-07 00:00:00.000 | Be Unique  | South America             | Gen Z (2000s - now)     | Other    | Opens          |                      4 |       3 |
|         4 |                    1 | $0 - $100         |     84.17 |     1 |       0 | Urban      |        1 | Web       | Womens E-Mail |       0 |        0 |     25860 |             4 | Computers          | 2017-03-29 00:00:00.000 | Summer Fun | North and Central America | Gen Z (2000s - now)     | Female   | Clicks         |                      4 |       3 |
|        10 |                    1 | $0 - $100         |    181.98 |     0 |       1 | Urban      |        1 | Web       | Mens E-Mail   |       0 |        0 |     14700 |             3 | Home Automation    | 2017-03-31 00:00:00.000 | Be Unique  | North and Central America | Baby Boomers (45 – 60s) | Male     | Opens          |                      1 |       3 |
|        12 |                    3 | $200 - $350       |    160.04 |     1 |       0 | Rural      |        0 | Web       | Mens E-Mail   |       0 |        0 |     61650 |             2 | Electronics        | 2017-04-03 00:00:00.000 | Get Sporty | North and Central America | Gen Y (80 – 2000s)      | Male     | Clicks         |                      3 |       4 |
|         2 |                    2 | $100 - $200       |    612.28 |     1 |       0 | Surburban  |        1 | Phone     | Womens E-Mail |       0 |        0 |     12600 |             4 | Computers          | 2017-04-10 00:00:00.000 | Summer Fun | South America             | Baby Boomers (45 – 60s) | Female   | Clicks         |                      1 |       4 |
|         1 |                    4 | $350 - $500       |    354.03 |     1 |       0 | Urban      |        0 | Web       | Mens E-Mail   |       0 |        0 |     17490 |             2 | Electronics        | 2017-04-17 00:00:00.000 | Get Sporty | Europe                    | Gen X (60 – 80s)        | Male     | Opens          |                      2 |       4 |


Table: LocationAnalytics
| Day                     | Region                  | Product Category   |   Visit Start |   Visit End |   Hour | Visitor ID                                  | First Visit   |   Duration |   Minutes | Threshold   | Country   | Department   | Gender   | Customer Segment        | Date                    |   Popularity |   Engagement |   Acquisition |   Loyalty |   Conversion |   Revenue | WeekDay   |   WeekNumber | Visit Type   | Loyal Customer Flag   | Visitor ID (clusters)    |
|:------------------------|:------------------------|:-------------------|--------------:|------------:|-------:|:--------------------------------------------|:--------------|-----------:|----------:|:------------|:----------|:-------------|:---------|:------------------------|:------------------------|-------------:|-------------:|--------------:|----------:|-------------:|----------:|:----------|-------------:|:-------------|:----------------------|:-------------------------|
| 2016-08-04 00:00:00.000 | North & Central America | Electronics        |      0.507639 |    0.508368 |     12 | SqvRGNgNbVPS5RUPTo0b3o+PAcUKOLhgFBkGd6D5WxU | True          |         63 |      1.05 | passing     | USA       | Accessories  | Other    | Baby Boomers (45 – 60s) | 2016-09-29 00:00:00.000 |          315 |           31 |      0.588192 |   1.66604 |     0.587059 |      5951 | Thursday  |            5 | First Visit  | Not Loyal             | Cluster1                 |
| 2016-08-02 00:00:00.000 | North & Central America | Electronics        |      0.551366 |    0.552095 |     13 | 5pWyKEIsP8VfJuGL9mrjR5R+RofdC0JWICWXuFGTRIE | True          |         63 |      1.05 | long        | USA       | Accessories  | Other    | Baby Boomers (45 – 60s) | 2016-08-10 00:00:00.000 |          496 |            3 |      0.339117 |   4.99035 |     0.315654 |      5059 | Tuesday   |            3 | First Visit  | Loyal                 | Cluster4                 |
| 2016-08-04 00:00:00.000 | North & Central America | Electronics        |      0.59897  |    0.599699 |     12 | q77jQkTwY03fZhBAtW0mlqSXjxL7dGryu6s6tKT97kw | True          |         63 |      1.05 | long        | USA       | Accessories  | Male     | Baby Boomers (45 – 60s) | 2016-08-13 00:00:00.000 |          560 |           36 |      0.316225 |   2.03972 |     0.749783 |      2615 | Thursday  |            5 | First Visit  | Not Loyal             | Cluster3                 |
| 2016-08-06 00:00:00.000 | North & Central America | Electronics        |      0.863461 |    0.86419  |     20 | fXtddzS/i26DhmKd3M5dQo077H5fLgTO1VO9oJvBLnI | True          |         63 |      1.05 | passing     | USA       | Accessories  | Female   | Baby Boomers (45 – 60s) | 2016-08-04 00:00:00.000 |          163 |           31 |      0.322253 |   1.82575 |     0.312414 |     29551 | Saturday  |            7 | First Visit  | Not Loyal             | Cluster1                 |
| 2016-08-04 00:00:00.000 | North & Central America | Electronics        |      0.942581 |    0.94331  |     22 | yH+pHX664Jbl2jiblwb6JxN7qKRPTkE3kAJV6RmXSKA | True          |         63 |      1.05 | passing     | USA       | Accessories  | Other    | Baby Boomers (45 – 60s) | 2016-09-12 00:00:00.000 |          403 |           27 |      0.533344 |   2.99078 |     0.478836 |     32962 | Thursday  |            5 | First Visit  | Loyal                 | Cluster4                 |
| 2016-08-01 00:00:00.000 | North & Central America | Electronics        |      0.527072 |    0.527801 |     12 | gd7IhZ6vIe/20LESJySbTnxbL0f/Qy2okZqXishya6U | True          |         63 |      1.05 | long        | USA       | Accessories  | Female   | Gen X (60 – 80s)        | 2016-08-06 00:00:00.000 |          936 |           22 |      0.514732 |   1.34245 |     0.731245 |     21674 | Monday    |            2 | First Visit  | Not Loyal             | Cluster3                 |
| 2016-08-02 00:00:00.000 | North & Central America | Electronics        |      0.530833 |    0.531563 |     12 | OEmnKaQpEOn2DLw3C2UfB1kKK+2ipViKwErzIE3gnEk | True          |         63 |      1.05 | medium      | USA       | Accessories  | Female   | Gen X (60 – 80s)        | 2016-08-13 00:00:00.000 |          305 |            6 |      0.567368 |   1.43182 |     0.408315 |      3937 | Tuesday   |            3 | First Visit  | Not Loyal             | Cluster1                 |
| 2016-08-04 00:00:00.000 | North & Central America | Electronics        |      0.86103  |    0.861759 |     20 | YU26z44cOUTR9g6rTcMfDixtOjbS/KULQBlGyjqeElg | True          |         63 |      1.05 | long        | USA       | Accessories  | Other    | Gen X (60 – 80s)        | 2016-09-02 00:00:00.000 |          503 |           28 |      0.624395 |   2.14197 |     0.426152 |     37360 | Thursday  |            5 | First Visit  | Not Loyal             | Cluster3                 |
| 2016-08-07 00:00:00.000 | North & Central America | Electronics        |      0.475729 |    0.476458 |     11 | ChCASxHqWu8O0O/TJkX83A0CI2RojbHDH2wvRU8O9qs | True          |         63 |      1.05 | medium      | USA       | Accessories  | Other    | Gen Y (80 – 2000s)      | 2016-08-16 00:00:00.000 |          151 |            9 |      0.554257 |   3.95741 |     0.607451 |     27592 | Sunday    |            1 | First Visit  | Loyal                 | Cluster4                 |
| 2016-08-04 00:00:00.000 | North & Central America | Electronics        |      0.732373 |    0.733102 |     17 | e1XOP8pT00B8Txe7EFsfELhAo6hewFfz7KXqpCbztJM | True          |         63 |      1.05 | passing     | USA       | Accessories  | Female   | Gen Y (80 – 2000s)      | 2016-08-07 00:00:00.000 |          565 |            3 |      0.609629 |   4.39113 |     0.467605 |     31226 | Thursday  |            5 | First Visit  | Loyal                 | Cluster2                 |


Table: Stores
| Country   |   Stores |
|:----------|---------:|
| Australia |       76 |
| Brazil    |       85 |
| Canada    |       75 |
| China     |       65 |
| France    |       57 |
| Germany   |       58 |
| India     |       62 |
| Indonesia |       54 |
| Italy     |       70 |
| Japan     |       61 |


Table: WebsiteSocialAnalytics
| Country   | Product Category   | Product          | Channel   | Gender   |   Sessions | Device Category   | Sources   | Conversations   | Page             |   Visits |   Unique Visitors | Browser           | Sentiment   |   Duration (min) | Region                  | Customer Segment        |   Daily Users |   Conversion Rate (%) |   Return Visitors |   Tweets |   Retweets | Hashtags           | Campaign Name    |   Customer Segment Key |
|:----------|:-------------------|:-----------------|:----------|:---------|-----------:|:------------------|:----------|:----------------|:-----------------|---------:|------------------:|:------------------|:------------|-----------------:|:------------------------|:------------------------|--------------:|----------------------:|------------------:|---------:|-----------:|:-------------------|:-----------------|-----------------------:|
| Canada    | PC Hardware        | Accessories      | Online    | Female   |        916 | Mobile            | Bing      | Forum           | Products         |      480 |               142 | Chrome            | Neutral     |                4 | North & Central America | Gen X (60 – 80s)        |           200 |                   200 |               142 |      406 |         20 | #boring            | Get Sporty       |                      2 |
| China     | Electronics        | Cables           | Online    | Male     |        878 | Desktop           | Google    | Twitter         | Contact Us       |      504 |               181 | Internet Explorer | Positive    |                4 | Asia Pacific            | Gen X (60 – 80s)        |           200 |                    19 |               181 |       56 |         31 | #futureTech        | Seasonal Savings |                      2 |
| India     | Electronics        | Cases & Carriers | Online    | Male     |        867 | Desktop           | Facebook  | Facebook        | Products         |      592 |                59 | Internet Explorer | Neutral     |                5 | Asia Pacific            | Gen X (60 – 80s)        |           410 |                    48 |                59 |       57 |         30 | #futureTech        | Seasonal Savings |                      2 |
| India     | Electronics        | Sound            | Online    | Other    |        752 | Desktop           | Facebook  | Facebook        | HomePage         |      448 |               106 | Edge              | Positive    |                4 | Asia Pacific            | Gen X (60 – 80s)        |           270 |                    48 |               106 |      122 |         29 | #futureTech        | Seasonal Savings |                      2 |
| France    | Electronics        | Sound            | Online    | Female   |        624 | Mobile            | Google    | Twitter         | Shipping Details |      403 |               194 | Internet Explorer | Positive    |                2 | Europe                  | Gen X (60 – 80s)        |           422 |                    20 |               194 |      143 |         47 | #futureTech        | Seasonal Savings |                      2 |
| USA       | Electronics        | Chargers         | Online    | Female   |        767 | Mobile            | Bing      | Forum           | Products         |      553 |               197 | Chrome            | Neutral     |                4 | North & Central America | Gen X (60 – 80s)        |           366 |                    40 |               197 |      105 |         32 | #futureTech        | Fun with Colors  |                      2 |
| Brazil    | Electronics        | Sound            | Online    | Male     |        761 | Tablet            | Bing      | Twitter         | Contact Us       |      462 |               140 | Firefox           | Negative    |                2 | South America           | Gen Y (80 – 2000s)      |           414 |                    41 |               140 |       91 |         29 | #futureTech        | Fun with Colors  |                      3 |
| Indonesia | Electronics        | Accessories      | Online    | Male     |        884 | Desktop           | Yahoo     | Forum           | Shipping Details |      538 |                69 | Firefox           | Positive    |                5 | Asia Pacific            | Gen Z (2000s - now)     |           481 |                    48 |                69 |      131 |         23 | #futureTech        | High Tech        |                      4 |
| USA       | Electronics        | Tablets          | Online    | Male     |        633 | Mobile            | Google    | Twitter         | Contact Us       |      409 |               153 | Firefox           | Positive    |                2 | North & Central America | Gen Z (2000s - now)     |           393 |                    43 |               153 |      120 |         23 | #futureTech        | Just for You     |                      4 |
| France    | PC and Tablets     | Audio            | Online    | Female   |        851 | Mobile            | Google    | Blogs           | Products         |      539 |                93 | Edge              | Negative    |                3 | Europe                  | Baby Boomers (45 – 60s) |           242 |                    34 |                93 |      433 |         30 | #gamingwithfriends | Fun with Colors  |                      1 |

 


tables: name: Campaign Analytics
data: Campaign Analytics.csv
name: Customer Segment
data: Customer Segment.csv
name: DimDate
data: DimDate.csv
name: Email Analytics Target Revenue
data: Email Analytics Target Revenue.csv
name: Email Analytics
data: Email Analytics.csv
name: LocationAnalytics
data: LocationAnalytics.csv
name: Stores
data: Stores.csv
name: WebsiteSocialAnalytics
data: WebsiteSocialAnalytics.csv
label: Email Analytics
Date
DimDate
DateValue
Email Analytics
Customer Segment
Customer Segment
Customer Segment
WebsiteSocialAnalytics
Customer Segment
Customer Segment
Customer Segment
LocationAnalytics
Customer Segment
Customer Segment
Customer Segment
Campaign Analytics
Customer Segment
Customer Segment
Customer Segment
WebsiteSocialAnalytics
Country
Stores
Country
LocationAnalytics
Country
Stores
Country
Campaign Analytics
Country
Stores
Country
Email Analytics
Campaign
Email Analytics Target Revenue
Campaign Name
output: {
    "joins": [
        {
            "from_table": "Email Analytics",
            "from_column": "Date",
            "to_table": "DimDate",
            "to_column": "DateValue"
        },
        {
            "from_table": "Email Analytics",
            "from_column": "Customer Segment",
            "to_table": "Customer Segment",
            "to_column": "Customer Segment"
        },
        {
            "from_table": "WebsiteSocialAnalytics",
            "from_column": "Customer Segment",
            "to_table": "Customer Segment",
            "to_column": "Customer Segment"
        },
        {
            "from_table": "LocationAnalytics",
            "from_column": "Customer Segment",
            "to_table": "Customer Segment",
            "to_column": "Customer Segment"
        },
        {
            "from_table": "Campaign Analytics",
            "from_column": "Customer Segment",
            "to_table": "Customer Segment",
            "to_column": "Customer Segment"
        },
        {
            "from_table": "WebsiteSocialAnalytics",
            "from_column": "Country",
            "to_table": "Stores",
            "to_column": "Country"
        },
        {
            "from_table": "LocationAnalytics",
            "from_column": "Country",
            "to_table": "Stores",
            "to_column": "Country"
        },
        {
            "from_table": "Campaign Analytics",
            "from_column": "Country",
            "to_table": "Stores",
            "to_column": "Country"
        },
        {
            "from_table": "Email Analytics",
            "from_column": "Campaign",
            "to_table": "Email Analytics Target Revenue",
            "to_column": "Campaign Name"
        }
    ]
}