def get_relations_and_conditions(parsed_sql):
    """Given normalized parsed SQL, return a list of relations and list of conditions including all
    join- and where-conditions.
    """

    relations = [subclause['relation'] for subclause in parsed_sql.from_clause]
    conditions = [
        subclause['join_conditions'] for subclause in parsed_sql.from_clause
        if 'join_conditions' in subclause
    ]
    conditions.extend(parsed_sql.where_clause)
    conjunctions = ['and'] * len(conditions)
    conditions = [ part for parts in zip(conditions, conjunctions) for part in parts ][:-1]

    return relations, conditions