def daily_query(city):
    """SQL query to get daily transactions according to the city
    """
    if city not in ('bordeaux', 'lyon'):
        raise ValueError("City '{}' not supported.".format(city))
    return """SELECT id
           ,number AS value
           ,date
           ,name
        FROM {schema}.{table} AS X
        LEFT JOIN {schema}.{station} AS Y using(id)
        WHERE id IN %(id_list)s AND date >= %(start)s AND date <= %(stop)s
        ORDER BY id,date""".format(schema=city,
                                   table='daily_transaction',
                                   station='station')