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: CustomersAllStores
|   ID | FirstName   | LastName    | City      | Country   | Phone        | Email                         | AmountSpent        |
|-----:|:------------|:------------|:----------|:----------|:-------------|:------------------------------|:-------------------|
| 1001 | Broderick   | Drayson     | Wenqiao   | China     | 875-727-5031 | bdrayson0@people.com.cn       | 1995.1600000000003 |
| 1013 | Lebbie      | Carling     | Heling    | China     | 281-337-8891 | lcarlingc@reddit.com          | 7632.32            |
| 1014 | Sofie       | Durante     | Jinhu     | China     | 100-662-6214 | sduranted@unc.edu             | 30796.34           |
| 1017 | Dwight      | Grivori     | Shengtang | China     | 722-390-5206 | dgrivorig@yahoo.co.jp         | 15593.400000000001 |
| 1020 | Louise      | Lorking     | Tayuan    | China     | 612-946-4723 | llorkingj@alibaba.com         | 3308.9400000000005 |
| 1027 | Judd        | Mattessen   | Xinglong  | China     | 222-304-5647 | jmattessenq@wikia.com         | 3279.2899999999995 |
| 1048 | Dalenna     | Tschirasche | Xingou    | China     | 979-331-9865 | dtschirasche1b@bing.com       | 12332.99           |
| 1050 | Corinna     | Leppington  | Zhaigang  | China     | 680-866-5565 | cleppington1d@list-manage.com | 5243.1             |
| 1060 | Alvy        | Eskrigge    | Jianxin   | China     | 626-385-5822 | aeskrigge1n@paginegialle.it   |                    |
| 1064 | Briant      | Lightoller  | Maying    | China     | 648-153-6421 | blightoller1r@hugedomains.com | 12529.250000000002 |


Table: OrderHAllStores
|   id | Orderdate               |   ordernumber |   customerid |   storeid | AmountSpent        | TotalSpent         |
|-----:|:------------------------|--------------:|-------------:|----------:|:-------------------|:-------------------|
|   33 | 2014-05-08 00:00:00.000 |       1543239 |         1097 |         1 |                    |                    |
|   34 | 2014-05-08 00:00:00.000 |       1543240 |         1020 |         1 | 3308.9400000000005 | 3308.9400000000005 |
|   35 | 2014-05-08 00:00:00.000 |       1543241 |         1010 |         1 | 10391.66           | 56026.539999999994 |
|   36 | 2014-05-08 00:00:00.000 |       1543242 |         1018 |         1 | 4965.1900000000005 | 13748.42           |
|   37 | 2014-05-08 00:00:00.000 |       1543243 |         1041 |         1 | 4419.97            | 26184.27           |
|   38 | 2014-05-08 00:00:00.000 |       1543244 |         1096 |         1 | 4500.14            | 8901.29            |
|   39 | 2014-05-08 00:00:00.000 |       1543245 |         1052 |         1 | 1220.1599999999999 | 19514.73           |
|   40 | 2014-05-08 00:00:00.000 |       1543246 |         1018 |         1 | 8783.23            | 13748.42           |
|   41 | 2014-05-08 00:00:00.000 |       1543247 |         1022 |         1 | 5603.7799999999988 | 16273.499999999998 |
|   42 | 2014-05-08 00:00:00.000 |       1543248 |         1025 |         1 | 8933.17            | 12307.54           |


Table: OrderIAllStores
|   id |     OrderId |   ProductId |   UnitPrice |   Quantity |   PricePerOrder |   TotalPrice |
|-----:|------------:|------------:|------------:|-----------:|----------------:|-------------:|
|    1 | 1.54321e+06 |          71 |       22.41 |         10 |           224.1 |       224.1  |
|    2 | 1.54321e+06 |           6 |       31.25 |         85 |         12333   |      2656.25 |
|    3 | 1.54321e+06 |          16 |       22.43 |         26 |         12333   |       583.18 |
|    4 | 1.54321e+06 |          35 |       32.26 |         15 |         12333   |       483.9  |
|    5 | 1.54321e+06 |          34 |       20.9  |         97 |         12333   |      2027.3  |
|    6 | 1.54321e+06 |          37 |       26.8  |         10 |         12333   |       268    |
|    7 | 1.54321e+06 |          53 |       51.02 |         86 |         12333   |      4387.72 |
|    8 | 1.54321e+06 |          71 |       36.4  |         31 |         12333   |      1128.4  |
|    9 | 1.54321e+06 |          74 |       16.63 |         48 |         12333   |       798.24 |
|   10 | 1.54321e+06 |          56 |       46    |         58 |         31246   |      2668    |


Table: Products
|   Id | ProductName                     |   UnitPrice | Package             |   IsDiscontinued |
|-----:|:--------------------------------|------------:|:--------------------|-----------------:|
|    1 | Chai                            |          18 | 10 boxes x 20 bags  |                0 |
|    2 | Chang                           |          19 | 24 - 12 oz bottles  |                0 |
|    3 | Aniseed Syrup                   |          10 | 12 - 550 ml bottles |                0 |
|    4 | Chef Anton's Cajun Seasoning    |          22 | 48 - 6 oz jars      |                0 |
|    6 | Grandma's Boysenberry Spread    |          25 | 12 - 8 oz jars      |                0 |
|    7 | Uncle Bob's Organic Dried Pears |          30 | 12 - 1 lb pkgs.     |                0 |
|    8 | Northwoods Cranberry Sauce      |          40 | 12 - 12 oz jars     |                0 |
|   10 | Ikura                           |          31 | 12 - 200 ml jars    |                0 |
|   11 | Queso Cabrales                  |          21 | 1 kg pkg.           |                0 |
|   12 | Queso Manchego La Pastora       |          38 | 10 - 500 g pkgs.    |                0 |


Table: Store1customers
|   ID | FirstName   | LastName   | City         | Country     | Phone        | Email                       | AmountSpent        |
|-----:|:------------|:-----------|:-------------|:------------|:-------------|:----------------------------|:-------------------|
| 1001 | Broderick   | Drayson    | Wenqiao      | China       | 875-727-5031 | bdrayson0@people.com.cn     | 1995.1600000000003 |
| 1002 | Irena       | Halson     | Guiglo       | Ivory Coast | 136-790-8628 | ihalson1@soup.io            | 1486.1000000000001 |
| 1003 | Hillel      | Prothero   | Bla          | Mali        | 758-658-3589 | hprothero2@wunderground.com |                    |
| 1004 | Cozmo       | Sier       | Las Americas | Mexico      | 968-112-5531 | csier3@tinypic.com          | 17596.75           |
| 1005 | Denis       | Keech      | Skála        | Greece      | 580-905-5960 | dkeech4@tiny.cc             | 497.2              |
| 1006 | Lambert     | Ebsworth   | Canalete     | Colombia    | 559-736-2403 | lebsworth5@wisc.edu         | 33763.76           |
| 1007 | Tarrah      | Ahern      | Bujumbura    | Burundi     | 863-117-1451 | tahern6@lulu.com            | 7921.7199999999993 |
| 1008 | Gare        | Lydster    | Ailigandí    | Panama      | 864-443-6585 | glydster7@slashdot.org      | 3309.8500000000004 |
| 1009 | Ron         | Seacroft   | Ljungby      | Sweden      | 496-377-5466 | rseacroft8@usgs.gov         | 7830.92            |
| 1010 | Eleanora    | Younge     | Weligama     | Sri Lanka   | 908-967-8596 | eyounge9@wikimedia.org      | 56026.539999999994 |


Table: Store1OrderH
|   id | Orderdate               |   ordernumber |   customerid |   storeid | TotalAmount        |
|-----:|:------------------------|--------------:|-------------:|----------:|:-------------------|
|   33 | 2014-05-08 00:00:00.000 |       1543239 |         1097 |         1 |                    |
|   34 | 2014-05-08 00:00:00.000 |       1543240 |         1020 |         1 | 3308.9400000000005 |
|   35 | 2014-05-08 00:00:00.000 |       1543241 |         1010 |         1 | 10391.66           |
|   36 | 2014-05-08 00:00:00.000 |       1543242 |         1018 |         1 | 4965.1900000000005 |
|   37 | 2014-05-08 00:00:00.000 |       1543243 |         1041 |         1 | 4419.97            |
|   38 | 2014-05-08 00:00:00.000 |       1543244 |         1096 |         1 | 4500.14            |
|   39 | 2014-05-08 00:00:00.000 |       1543245 |         1052 |         1 | 1220.1599999999999 |
|   40 | 2014-05-08 00:00:00.000 |       1543246 |         1018 |         1 | 8783.23            |
|   41 | 2014-05-08 00:00:00.000 |       1543247 |         1022 |         1 | 5603.7799999999988 |
|   42 | 2014-05-08 00:00:00.000 |       1543248 |         1025 |         1 | 8933.17            |


Table: Store1OrderI
|   id |     OrderId |   ProductId |   UnitPrice |   Quantity |   TotalPrice |   PricePerOrder |
|-----:|------------:|------------:|------------:|-----------:|-------------:|----------------:|
|    1 | 1.54321e+06 |          71 |       22.41 |         10 |       224.1  |           224.1 |
|    2 | 1.54321e+06 |           6 |       31.25 |         85 |      2656.25 |         12333   |
|    3 | 1.54321e+06 |          16 |       22.43 |         26 |       583.18 |         12333   |
|    4 | 1.54321e+06 |          35 |       32.26 |         15 |       483.9  |         12333   |
|    5 | 1.54321e+06 |          34 |       20.9  |         97 |      2027.3  |         12333   |
|    6 | 1.54321e+06 |          37 |       26.8  |         10 |       268    |         12333   |
|    7 | 1.54321e+06 |          53 |       51.02 |         86 |      4387.72 |         12333   |
|    8 | 1.54321e+06 |          71 |       36.4  |         31 |      1128.4  |         12333   |
|    9 | 1.54321e+06 |          74 |       16.63 |         48 |       798.24 |         12333   |
|   10 | 1.54321e+06 |          56 |       46    |         58 |      2668    |         31246   |


Table: Store2customers
|   ID | FirstName   | LastName   | City       | Country            | Phone        | Email                      | AmountSpent        |
|-----:|:------------|:-----------|:-----------|:-------------------|:-------------|:---------------------------|:-------------------|
| 2001 | Patricio    | Renzullo   | Jingxiyuan | China              | 856-945-4611 | prenzullo0@aboutads.info   | 2224.86            |
| 2002 | Philipa     | Canellas   | Silodakon  | Indonesia          | 338-901-3118 | pcanellas1@list-manage.com |                    |
| 2003 | Valry       | Woolger    | Girsereng  | Indonesia          | 749-876-5170 | vwoolger2@hibu.com         |                    |
| 2004 | Sherye      | Scholl     | Sinargalih | Indonesia          | 609-867-8459 | sscholl3@goo.gl            | 43051.899999999994 |
| 2005 | Linnie      | Menure     | Huyuan     | China              | 192-435-9642 | lmenure4@foxnews.com       | 5376.02            |
| 2006 | Herby       | Linnard    | Pimentel   | Dominican Republic | 442-921-3879 | hlinnard5@jugem.jp         | 4987.32            |
| 2007 | Katuscha    | Gude       | Xiangshi   | China              | 927-876-2935 | kgude6@icq.com             | 25650.14           |
| 2008 | Maressa     | Rigg       | Oli        | Indonesia          | 923-149-8928 | mrigg7@loc.gov             | 9222.98            |
| 2009 | Kynthia     | Mordue     | Tomingad   | Philippines        | 598-473-9700 | kmordue8@alexa.com         |                    |
| 2010 | Del         | Fazzioli   | Linglong   | China              | 390-130-6163 | dfazzioli9@cbsnews.com     |                    |


Table: Store2OrderH
|   id | Orderdate               |   ordernumber |   customerid |   storeid |   TotalAmount |
|-----:|:------------------------|--------------:|-------------:|----------:|--------------:|
|    1 | 2014-05-07 00:00:00.000 |       2543207 |         2052 |         2 |        552.91 |
|    2 | 2014-05-07 00:00:00.000 |       2543208 |         2035 |         2 |       6893.78 |
|    3 | 2014-05-07 00:00:00.000 |       2543209 |         2078 |         2 |       7416.84 |
|    4 | 2014-05-07 00:00:00.000 |       2543210 |         2059 |         2 |       4605.06 |
|    5 | 2014-05-07 00:00:00.000 |       2543211 |         2060 |         2 |       6193.89 |
|    6 | 2014-05-07 00:00:00.000 |       2543212 |         2020 |         2 |       4504.82 |
|    7 | 2014-05-07 00:00:00.000 |       2543213 |         2040 |         2 |       6468.68 |
|    8 | 2014-05-07 00:00:00.000 |       2543214 |         2071 |         2 |       6510.78 |
|    9 | 2014-05-07 00:00:00.000 |       2543215 |         2094 |         2 |      13698.7  |
|   10 | 2014-05-07 00:00:00.000 |       2543216 |         2007 |         2 |       3334.59 |


Table: Store2OrderI
|   id |     OrderId |   ProductId |   UnitPrice |   Quantity |   TotalPrice |   PricePerOrder |
|-----:|------------:|------------:|------------:|-----------:|-------------:|----------------:|
|    1 | 2.54321e+06 |          47 |       18.09 |          3 |        54.27 |          552.91 |
|    2 | 2.54321e+06 |          54 |       10.84 |         46 |       498.64 |          552.91 |
|    3 | 2.54321e+06 |          71 |       22.82 |         36 |       821.52 |         6893.78 |
|    4 | 2.54321e+06 |          14 |       26.61 |         58 |      1543.38 |         6893.78 |
|    5 | 2.54321e+06 |          44 |       19.59 |         97 |      1900.23 |         6893.78 |
|    6 | 2.54321e+06 |           2 |       27.67 |         95 |      2628.65 |         6893.78 |
|    7 | 2.54321e+06 |           3 |       19.89 |         89 |      1770.21 |         7416.84 |
|    8 | 2.54321e+06 |          60 |       44.94 |         22 |       988.68 |         7416.84 |
|    9 | 2.54321e+06 |          67 |       14    |         93 |      1302    |         7416.84 |
|   10 | 2.54321e+06 |          20 |      144.16 |         20 |      2883.2  |         7416.84 |


Table: Store3customers
|   ID | FirstName   | LastName    | City        | Country            | Phone        | Email                       | AmountSpent        |
|-----:|:------------|:------------|:------------|:-------------------|:-------------|:----------------------------|:-------------------|
| 3001 | Reyna       | Boorn       | Taozhou     | China              | 836-753-5121 | rboorn0@google.cn           |                    |
| 3002 | Georgia     | Berringer   | Willowmore  | South Africa       | 354-740-1538 | gberringer1@slashdot.org    |                    |
| 3003 | Nikolaos    | Quarry      | Partido     | Dominican Republic | 219-572-9700 | nquarry2@latimes.com        | 2449.7278190640004 |
| 3004 | Chrisy      | Hessentaler | Topeka      | United States      | 785-480-1426 | chessentaler3@zimbio.com    |                    |
| 3005 | Petunia     | Joynson     | Dzhankoy    | Ukraine            | 387-578-8934 | pjoynson4@last.fm           |                    |
| 3006 | Adolf       | Wivell      | ֳpsonas             | Cyprus             | 380-842-1489 | awivell5@simplemachines.org |                    |
| 3007 | Josias      | Vousden     | Yartsevo    | Russia             | 799-574-4337 | jvousden6@goodreads.com     | 474.76534742999996 |
| 3008 | Joleen      | Slide       | Kalֳ¡ Dֳ©ndra | Greece             | 915-406-7835 | jslide7@whitehouse.gov      |                    |
| 3009 | Craggie     | Brimming    | Pedome      | Portugal           | 304-432-0407 | cbrimming8@fastcompany.com  | 2365.516827266     |
| 3010 | Ravi        | Beade       | Liangwa     | China              | 116-236-0169 | rbeade9@diigo.com           | 4755.84251253      |


Table: Store3OrderH
|   id | Orderdate               |   ordernumber |   customerid |   storeid |   TotalAmount |
|-----:|:------------------------|--------------:|-------------:|----------:|--------------:|
|    1 | 2014-05-07 00:00:00.000 |       3543207 |         3018 |         3 |      1610.87  |
|    2 | 2014-05-07 00:00:00.000 |       3543208 |         3012 |         3 |       101.794 |
|    3 | 2014-05-07 00:00:00.000 |       3543209 |         3044 |         3 |       292.107 |
|    4 | 2014-05-07 00:00:00.000 |       3543210 |         3022 |         3 |       800.21  |
|    5 | 2014-05-07 00:00:00.000 |       3543211 |         3079 |         3 |      1830.41  |
|    6 | 2014-05-07 00:00:00.000 |       3543212 |         3025 |         3 |      9628.52  |
|    7 | 2014-05-07 00:00:00.000 |       3543213 |         3012 |         3 |       676.324 |
|    8 | 2014-05-07 00:00:00.000 |       3543214 |         3066 |         3 |      1693.77  |
|    9 | 2014-05-07 00:00:00.000 |       3543215 |         3058 |         3 |      2510.21  |
|   10 | 2014-05-07 00:00:00.000 |       3543216 |         3054 |         3 |       684.415 |


Table: Store3OrderI
|   id |     OrderId |   ProductId |   UnitPrice |   Quantity |   TotalPrice |   PricePerOrder |
|-----:|------------:|------------:|------------:|-----------:|-------------:|----------------:|
|    1 | 3.54321e+06 |          51 |    10.9691  |          8 |      87.7528 |        1610.87  |
|    2 | 3.54321e+06 |          71 |    20.0206  |         52 |    1041.07   |        1610.87  |
|    3 | 3.54321e+06 |          29 |    96.4094  |          5 |     482.047  |        1610.87  |
|    4 | 3.54321e+06 |          73 |     8.3656  |          7 |      58.5592 |         101.794 |
|    5 | 3.54321e+06 |           8 |     2.8823  |         15 |      43.2345 |         101.794 |
|    6 | 3.54321e+06 |          21 |     3.14094 |         93 |     292.107  |         292.107 |
|    7 | 3.54321e+06 |          70 |     4.91377 |         34 |     167.068  |         800.21  |
|    8 | 3.54321e+06 |          72 |    37.2436  |         17 |     633.142  |         800.21  |
|    9 | 3.54321e+06 |          56 |    53.8356  |         34 |    1830.41   |        1830.41  |
|   10 | 3.54321e+06 |          65 |    23.5942  |        100 |    2359.42   |        9628.52  |

 


tables: name: CustomersAllStores
data: CustomersAllStores.csv
name: OrderHAllStores
data: OrderHAllStores.csv
name: OrderIAllStores
data: OrderIAllStores.csv
name: Products
data: Products.csv
name: Store1customers
data: Store1customers.csv
name: Store1OrderH
data: Store1OrderH.csv
name: Store1OrderI
data: Store1OrderI.csv
name: Store2customers
data: Store2customers.csv
name: Store2OrderH
data: Store2OrderH.csv
name: Store2OrderI
data: Store2OrderI.csv
name: Store3customers
data: Store3customers.csv
name: Store3OrderH
data: Store3OrderH.csv
name: Store3OrderI
data: Store3OrderI.csv
label: Store1OrderH
id
Store1OrderI
id
Products
Id
Store1OrderI
id
Store3OrderH
id
Store1OrderI
id
Store3OrderH
id
Store3OrderI
id
Store1OrderH
id
Store2OrderI
id
Store2OrderH
id
Store2OrderI
id
OrderIAllStores
id
Store2OrderI
id
OrderHAllStores
id
Store2OrderI
id
CustomersAllStores
LastName
Store1customers
LastName
CustomersAllStores
City
Store3customers
City
OrderHAllStores
customerid
CustomersAllStores
ID
output: {
    "joins": [
        {
            "from_table": "Store1OrderH",
            "from_column": "id",
            "to_table": "Store1OrderI",
            "to_column": "id"
        },
        {
            "from_table": "Products",
            "from_column": "Id",
            "to_table": "Store1OrderI",
            "to_column": "id"
        },
        {
            "from_table": "Store3OrderH",
            "from_column": "id",
            "to_table": "Store1OrderI",
            "to_column": "id"
        },
        {
            "from_table": "Store3OrderH",
            "from_column": "id",
            "to_table": "Store3OrderI",
            "to_column": "id"
        },
        {
            "from_table": "Store1OrderH",
            "from_column": "id",
            "to_table": "Store2OrderI",
            "to_column": "id"
        },
        {
            "from_table": "Store2OrderH",
            "from_column": "id",
            "to_table": "Store2OrderI",
            "to_column": "id"
        },
        {
            "from_table": "OrderIAllStores",
            "from_column": "id",
            "to_table": "Store2OrderI",
            "to_column": "id"
        },
        {
            "from_table": "OrderHAllStores",
            "from_column": "id",
            "to_table": "Store2OrderI",
            "to_column": "id"
        },
        {
            "from_table": "CustomersAllStores",
            "from_column": "LastName",
            "to_table": "Store1customers",
            "to_column": "LastName"
        },
        {
            "from_table": "CustomersAllStores",
            "from_column": "City",
            "to_table": "Store3customers",
            "to_column": "City"
        },
        {
            "from_table": "OrderHAllStores",
            "from_column": "customerid",
            "to_table": "CustomersAllStores",
            "to_column": "ID"
        }
    ]
}