def query_create_fact_table() -> str:
    """[this returns the query used for creating fact table. It uses the immigration and temperature tables' view.]

    Returns:
        str: [query to extract fact table.]
    """
    # defining query for creating fact table by joining temperature and immigration data
    query = '''
        select  im.dt                  AS dt,
                im.i94port             AS i94port,
                t.AverageTemperature   AS AverageTemperature
        from clean_immigration_usa_table AS im
        LEFT JOIN clean_temperature_usa_table AS t 
        ON im.i94port = t.i94port and t.dt = im.dt
    '''
    
    return query