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: sakila_dw dim_address
|   address_id | address                            | city              | country                       |                                           location |
|-------------:|:-----------------------------------|:------------------|:------------------------------|---------------------------------------------------:|
|           11 | 900 Santiago de Compostela Parkway | Kragujevac        | Yugoslavia                    | 00000000010100000000000000000000000000000000000000 |
|           16 | 808 Bhopal Manor                   | Yamuna Nagar      | India                         | 00000000010100000000000000000000000000000000000000 |
|           24 | 1688 Okara Way                     | Mardan            | Pakistan                      | 00000000010100000000000000000000000000000000000000 |
|           26 | 28 Charlotte Amalie Street         | Sal               | Morocco                       | 00000000010100000000000000000000000000000000000000 |
|           28 | 96 Tafuna Way                      | Crdoba            | Argentina                     | 00000000010100000000000000000000000000000000000000 |
|           30 | 18 Duisburg Boulevard              | Citt del Vaticano | Holy See (Vatican City State) | 00000000010100000000000000000000000000000000000000 |
|           31 | 217 Botshabelo Place               | Davao             | Philippines                   | 00000000010100000000000000000000000000000000000000 |
|           34 | 1668 Anpolis Street                | Lungtan           | Taiwan                        | 00000000010100000000000000000000000000000000000000 |
|           39 | 391 Callao Drive                   | Toulouse          | France                        | 00000000010100000000000000000000000000000000000000 |
|           43 | 306 Antofagasta Place              | Vila Velha        | Brazil                        | 00000000010100000000000000000000000000000000000000 |


Table: sakila_dw dim_bimester
|   dim_bimester | desc_dim_bimester   |
|---------------:|:--------------------|
|         200503 | Bimestre 3 de 2005  |
|         200504 | Bimestre 4 de 2005  |
|         200505 | Bimestre 5 de 2005  |
|         200601 | Bimestre 1 de 2006  |


Table: sakila_dw dim_customer
|   customer_id |   address_id | name             | active   |
|--------------:|-------------:|:-----------------|:---------|
|             1 |            5 | MARY SMITH       | activo   |
|             2 |            6 | PATRICIA JOHNSON | activo   |
|             3 |            7 | LINDA WILLIAMS   | activo   |
|             4 |            8 | BARBARA JONES    | activo   |
|             5 |            9 | ELIZABETH BROWN  | activo   |
|             6 |           10 | JENNIFER DAVIS   | activo   |
|             7 |           11 | MARIA MILLER     | activo   |
|             8 |           12 | SUSAN WILSON     | activo   |
|             9 |           13 | MARGARET MOORE   | activo   |
|            10 |           14 | DOROTHY TAYLOR   | activo   |


Table: sakila_dw dim_date
|   date_id | dim_date                |   dim_semester |   dim_quarter |   dim_bimester |   dim_month |   year_n |   month_day | weekday_n   |
|----------:|:------------------------|---------------:|--------------:|---------------:|------------:|---------:|------------:|:------------|
|  20050524 | 2005-05-24 00:00:00.000 |         200501 |        200502 |         200503 |      200505 |     2005 |          24 | Martes      |
|  20050525 | 2005-05-25 00:00:00.000 |         200501 |        200502 |         200503 |      200505 |     2005 |          25 | Miércoles   |
|  20050526 | 2005-05-26 00:00:00.000 |         200501 |        200502 |         200503 |      200505 |     2005 |          26 | Jueves      |
|  20050527 | 2005-05-27 00:00:00.000 |         200501 |        200502 |         200503 |      200505 |     2005 |          27 | Viernes     |
|  20050528 | 2005-05-28 00:00:00.000 |         200501 |        200502 |         200503 |      200505 |     2005 |          28 | Sábado      |
|  20050529 | 2005-05-29 00:00:00.000 |         200501 |        200502 |         200503 |      200505 |     2005 |          29 | Domingo     |
|  20050530 | 2005-05-30 00:00:00.000 |         200501 |        200502 |         200503 |      200505 |     2005 |          30 | Lunes       |
|  20050531 | 2005-05-31 00:00:00.000 |         200501 |        200502 |         200503 |      200505 |     2005 |          31 | Martes      |
|  20050601 | 2005-06-01 00:00:00.000 |         200501 |        200502 |         200503 |      200506 |     2005 |           1 | Miércoles   |
|  20050602 | 2005-06-02 00:00:00.000 |         200501 |        200502 |         200503 |      200506 |     2005 |           2 | Jueves      |


Table: sakila_dw dim_film
|   film_id | title                       | category   | language   | rating   |
|----------:|:----------------------------|:-----------|:-----------|:---------|
|         7 | AIRPLANE SIERRA             | Comedy     | English    | PG-13    |
|         9 | ALABAMA DEVIL               | Horror     | English    | PG-13    |
|        18 | ALTER VICTORY               | Animation  | English    | PG-13    |
|        28 | ANTHEM LUKE                 | Comedy     | English    | PG-13    |
|        33 | APOLLO TEEN                 | Drama      | English    | PG-13    |
|        35 | ARACHNOPHOBIA ROLLERCOASTER | Horror     | English    | PG-13    |
|        36 | ARGONAUTS TOWN              | Animation  | English    | PG-13    |
|        44 | ATTACKS HATE                | Sci-Fi     | English    | PG-13    |
|        45 | ATTRACTION NEWTON           | New        | English    | PG-13    |
|        48 | BACKLASH UNDEFEATED         | Children   | English    | PG-13    |


Table: sakila_dw dim_month
|   dim_month | desc_dim_month     |
|------------:|:-------------------|
|      200505 | Mayo de 2005       |
|      200506 | Junio de 2005      |
|      200507 | Julio de 2005      |
|      200508 | Agosto de 2005     |
|      200509 | Septiembre de 2005 |
|      200602 | Febrero de 2006    |


Table: sakila_dw dim_quarter
|   dim_quarter | desc_dim_quarter    |
|--------------:|:--------------------|
|        200502 | Trimestre 2 de 2005 |
|        200503 | Trimestre 3 de 2005 |
|        200601 | Trimestre 1 de 2006 |


Table: sakila_dw dim_semester
|   dim_semester | desc_dim_semester   |
|---------------:|:--------------------|
|         200501 | Semestre 1 de 2005  |
|         200502 | Semestre 2 de 2005  |
|         200601 | Semestre 1 de 2006  |


Table: sakila_dw dim_store
|   store_id |   address_id | store               |
|-----------:|-------------:|:--------------------|
|          1 |            1 | Lethbridge,Canada   |
|          2 |            2 | Woodridge,Australia |


Table: sakila_dw fact_rentals
| rental_id   |   film_id |   store_id |   customer_id |   date_id | staff_name   | transaction   | amount   |
|:------------|----------:|-----------:|--------------:|----------:|:-------------|:--------------|:---------|
| 12783R      |       246 |          2 |           503 |  20050819 | Jon Stephens | rental        |          |
| 12789R      |       526 |          2 |           557 |  20050819 | Jon Stephens | rental        |          |
| 12795R      |       602 |          2 |           360 |  20050819 | Jon Stephens | rental        |          |
| 12796R      |       284 |          2 |           368 |  20050819 | Jon Stephens | rental        |          |
| 12797R      |       349 |          2 |             5 |  20050819 | Jon Stephens | rental        |          |
| 12798R      |       922 |          2 |           534 |  20050819 | Jon Stephens | rental        |          |
| 12799R      |       849 |          2 |           197 |  20050819 | Jon Stephens | rental        |          |
| 12806R      |       980 |          2 |           423 |  20050819 | Jon Stephens | rental        |          |
| 12807R      |       504 |          2 |           513 |  20050819 | Jon Stephens | rental        |          |
| 12810R      |       295 |          2 |           250 |  20050819 | Jon Stephens | rental        |          |

 


tables: name: sakila_dw dim_address
data: sakila_dw dim_address.csv
name: sakila_dw dim_bimester
data: sakila_dw dim_bimester.csv
name: sakila_dw dim_customer
data: sakila_dw dim_customer.csv
name: sakila_dw dim_date
data: sakila_dw dim_date.csv
name: sakila_dw dim_film
data: sakila_dw dim_film.csv
name: sakila_dw dim_month
data: sakila_dw dim_month.csv
name: sakila_dw dim_quarter
data: sakila_dw dim_quarter.csv
name: sakila_dw dim_semester
data: sakila_dw dim_semester.csv
name: sakila_dw dim_store
data: sakila_dw dim_store.csv
name: sakila_dw fact_rentals
data: sakila_dw fact_rentals.csv
label: sakila_dw fact_rentals
customer_id
sakila_dw dim_customer
customer_id
sakila_dw fact_rentals
date_id
sakila_dw dim_date
date_id
sakila_dw fact_rentals
film_id
sakila_dw dim_film
film_id
sakila_dw fact_rentals
store_id
sakila_dw dim_store
store_id
sakila_dw dim_date
dim_semester
sakila_dw dim_semester
dim_semester
sakila_dw dim_date
dim_quarter
sakila_dw dim_quarter
dim_quarter
sakila_dw dim_date
dim_month
sakila_dw dim_month
dim_month
sakila_dw dim_date
dim_bimester
sakila_dw dim_bimester
dim_bimester
sakila_dw dim_customer
address_id
sakila_dw dim_address
address_id
output: {
    "joins": [
        {
            "from_table": "sakila_dw fact_rentals",
            "from_column": "customer_id",
            "to_table": "sakila_dw dim_customer",
            "to_column": "customer_id"
        },
        {
            "from_table": "sakila_dw fact_rentals",
            "from_column": "date_id",
            "to_table": "sakila_dw dim_date",
            "to_column": "date_id"
        },
        {
            "from_table": "sakila_dw fact_rentals",
            "from_column": "film_id",
            "to_table": "sakila_dw dim_film",
            "to_column": "film_id"
        },
        {
            "from_table": "sakila_dw fact_rentals",
            "from_column": "store_id",
            "to_table": "sakila_dw dim_store",
            "to_column": "store_id"
        },
        {
            "from_table": "sakila_dw dim_date",
            "from_column": "dim_semester",
            "to_table": "sakila_dw dim_semester",
            "to_column": "dim_semester"
        },
        {
            "from_table": "sakila_dw dim_date",
            "from_column": "dim_quarter",
            "to_table": "sakila_dw dim_quarter",
            "to_column": "dim_quarter"
        },
        {
            "from_table": "sakila_dw dim_date",
            "from_column": "dim_month",
            "to_table": "sakila_dw dim_month",
            "to_column": "dim_month"
        },
        {
            "from_table": "sakila_dw dim_date",
            "from_column": "dim_bimester",
            "to_table": "sakila_dw dim_bimester",
            "to_column": "dim_bimester"
        },
        {
            "from_table": "sakila_dw dim_customer",
            "from_column": "address_id",
            "to_table": "sakila_dw dim_address",
            "to_column": "address_id"
        }
    ]
}