def get_root_tables(metadata):
    """Get all root tables (tables who are never a child table in a foreign key relation)
        of the dataset.

    Args:
        metadata (dict): a ``MetaData`` instance

    Returns:
        set: the root table names
    """
    all_tables = {table['name'] for table in metadata.get_tables()}

    for fk in metadata.get_foreign_keys():
        if fk['table'] in all_tables:
            all_tables.remove(fk['table'])
    if len(all_tables) > 0:
        return all_tables
    else:
        return {table['name'] for table in metadata.get_tables()}