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: All measures
| Column1   |
|:----------|
| d         |


Table: Centre
|   CentreId | CentreName                   |   TownId |   CentreTypeId | PostCode   |   SquareMetres |   NumberUnits |
|-----------:|:-----------------------------|---------:|---------------:|:-----------|---------------:|--------------:|
|          1 | Pavilion Shopping Centre     |      180 |              3 | EN8 7BZ    |          15143 |            62 |
|          2 | Times Square Shopping Centre |      170 |              3 | SM1 1LF    |          15143 |            71 |
|          4 | Norman Park                  |        9 |              3 | CB3 8EL    |          15228 |            11 |
|          7 | Cannon Park Shopping Centre  |       48 |              3 | CV4 7EH    |          15329 |            36 |
|         12 | Kingsmead Shopping Centre    |       69 |              3 | GU14 7SJ   |          15515 |            69 |
|         13 | Market Quay                  |       68 |              3 | PO16       |          15515 |             0 |
|         19 | Old George Mall              |      148 |              3 | SP1 2NH    |          15794 |            37 |
|         20 | The Nicholson's Centre       |      113 |              3 | SL6 1LB    |          15794 |            64 |
|         25 | The Longford Shopping Centre |       70 |              3 | TW13 4BH   |          15979 |            85 |
|         26 | Southgate Shopping Centre    |       15 |              3 | BA1 1TQ    |          16072 |            34 |


Table: CentreType
|   CentreTypeId | CentreTypeName   |
|---------------:|:-----------------|
|              1 | Factory Outlet   |
|              2 | Retail Park      |
|              3 | Shopping Centre  |
|              4 | Shopping Park    |


Table: Environment
|   EnviromentId | EnvironmentName   |
|---------------:|:------------------|
|              1 | Land              |
|              2 | Air               |
|              3 | Water             |


Table: Family
|   FamilyId | FamilyName   |
|-----------:|:-------------|
|          1 | Reptile      |
|          2 | Fish         |
|          3 | Bird         |
|          4 | Amphibian    |
|          5 | Mammal       |
|          6 | Insect       |


Table: Habitat
|   HabitatId | HabitatName   |   EnvironmentId |
|------------:|:--------------|----------------:|
|           1 | Grasslands    |               1 |
|           2 | Forest        |               1 |
|           3 | Fresh water   |               3 |
|           4 | Salt water    |               3 |
|           5 | Desert        |               1 |
|           6 | Urban         |               1 |
|           7 | Sky           |               2 |


Table: Product
|   ProductId | ProductName   | Animal    |   HabitatId |   Legs |   FamilyId |
|------------:|:--------------|:----------|------------:|-------:|-----------:|
|           1 | Sammy         | Snake     |           1 |      0 |          1 |
|           2 | Pokyo         | Penguin   |           4 |      2 |          3 |
|           3 | Fenella       | Frog      |           3 |      4 |          4 |
|           4 | Layla         | Lemur     |           2 |      2 |          5 |
|           5 | Dave          | Dachsund  |           1 |      4 |          5 |
|           6 | Kylie         | Camel     |           5 |      4 |          5 |
|           7 | Jeremy        | Jackdaw   |           7 |      2 |          3 |
|           8 | Faye          | Fox       |           6 |      4 |          5 |
|           9 | Oliver        | Owl       |           7 |      2 |          3 |
|          10 | Cleopatra     | Clownfish |           4 |      0 |          2 |


Table: Purchase
|   PurchaseId | PurchaseDate            | PurchaseDateTime        |   ProductId |   CentreId |   Quantity |   Price | PaymentDate   |
|-------------:|:------------------------|:------------------------|------------:|-----------:|-----------:|--------:|:--------------|
|        15763 | 2014-01-04 00:00:00.000 | 2014-01-04 14:54:00.000 |           1 |        252 |          2 |     8.5 |               |
|        16093 | 2014-01-07 00:00:00.000 | 2014-01-07 12:44:00.000 |           1 |        341 |          2 |     8.5 |               |
|        17158 | 2014-01-13 00:00:00.000 | 2014-01-13 18:05:00.000 |           1 |        360 |          2 |     8.5 |               |
|        17637 | 2014-01-17 00:00:00.000 | 2014-01-17 15:40:00.000 |           1 |        309 |          2 |     8.5 |               |
|        17851 | 2014-01-19 00:00:00.000 | 2014-01-19 12:29:00.000 |           1 |        270 |          2 |     8.5 |               |
|        18325 | 2014-01-23 00:00:00.000 | 2014-01-23 16:58:00.000 |           1 |        326 |          2 |     8.5 |               |
|        18927 | 2014-01-29 00:00:00.000 | 2014-01-29 10:26:00.000 |           1 |        331 |          2 |     8.5 |               |
|        19027 | 2014-01-30 00:00:00.000 | 2014-01-30 18:24:00.000 |           1 |        383 |          2 |     8.5 |               |
|        19052 | 2014-01-31 00:00:00.000 | 2014-01-31 16:34:00.000 |           1 |        255 |          2 |     8.5 |               |
|        19271 | 2014-02-01 00:00:00.000 | 2014-02-01 16:55:00.000 |           1 |        375 |          2 |     8.5 |               |


Table: Region
|   RegionId | RegionName             |
|-----------:|:-----------------------|
|          1 | East Anglia            |
|          2 | East Midlands          |
|          3 | London                 |
|          4 | North                  |
|          5 | North West             |
|          6 | South East             |
|          7 | South West             |
|          8 | West Midlands          |
|          9 | Yorkshire & Humberside |


Table: Town
|   TownId | TownName          |   RegionId |
|---------:|:------------------|-----------:|
|        1 | Aintree           |          5 |
|        2 | Aldershot         |          6 |
|        3 | Altrincham        |          5 |
|        4 | Andover           |          6 |
|        5 | Ashford           |          6 |
|        6 | Ashton Under Lyne |          5 |
|        7 | Aylesbury         |          6 |
|        8 | Banbury           |          6 |
|        9 | Barhill           |          1 |
|       10 | Barking           |          3 |

 


tables: name: All measures
data: All measures.csv
name: Centre
data: Centre.csv
name: CentreType
data: CentreType.csv
name: Environment
data: Environment.csv
name: Family
data: Family.csv
name: Habitat
data: Habitat.csv
name: Product
data: Product.csv
name: Purchase
data: Purchase.csv
name: Region
data: Region.csv
name: Town
data: Town.csv
label: Centre
CentreTypeId
CentreType
CentreTypeId
Purchase
CentreId
Centre
CentreId
Centre
TownId
Town
TownId
Habitat
EnvironmentId
Environment
EnviromentId
Product
FamilyId
Family
FamilyId
Product
HabitatId
Habitat
HabitatId
Purchase
ProductId
Product
ProductId
Town
RegionId
Region
RegionId
output: {
    "joins": [
        {
            "from_table": "Centre",
            "from_column": "CentreTypeId",
            "to_table": "CentreType",
            "to_column": "CentreTypeId"
        },
        {
            "from_table": "Purchase",
            "from_column": "CentreId",
            "to_table": "Centre",
            "to_column": "CentreId"
        },
        {
            "from_table": "Centre",
            "from_column": "TownId",
            "to_table": "Town",
            "to_column": "TownId"
        },
        {
            "from_table": "Habitat",
            "from_column": "EnvironmentId",
            "to_table": "Environment",
            "to_column": "EnviromentId"
        },
        {
            "from_table": "Product",
            "from_column": "FamilyId",
            "to_table": "Family",
            "to_column": "FamilyId"
        },
        {
            "from_table": "Product",
            "from_column": "HabitatId",
            "to_table": "Habitat",
            "to_column": "HabitatId"
        },
        {
            "from_table": "Purchase",
            "from_column": "ProductId",
            "to_table": "Product",
            "to_column": "ProductId"
        },
        {
            "from_table": "Town",
            "from_column": "RegionId",
            "to_table": "Region",
            "to_column": "RegionId"
        }
    ]
}