def create_temp_pac_tables(self):
        self.log(" Creating yet more temporary tables")

        # Create a table of all committee filer ids that are not
        # linked to candidates.
        #
        # That means committees that:
        #
        #   A) Aren't already in our committee table
        #      as a candidate committee
        #
        #   B) Filed form F460 or F450
        #
        sql = """
            CREATE TEMPORARY TABLE tmp_other_filers (
                index(`filer_id`)
            ) AS (
                SELECT
                    DISTINCT f.`FILER_ID`
                FROM FILER_FILINGS_CD as f
                LEFT OUTER JOIN %(committee_model)s as c
                ON f.`FILER_ID` = c.`filer_id_raw`
                WHERE `FORM_ID` IN ('F460', 'F450')
                AND c.id IS NULL
            );
        """ % dict(committee_model=models.Committee._meta.db_table,)
        self.conn.execute(sql)

        # Now connect those with the FILERNAME_CD table and get
        # the maximum PK there to kill the duplicates
        sql = """
        CREATE TEMPORARY TABLE tmp_max_other_filers (
            index(`filer_id`),
            index(`max_id`)
        ) AS (
            SELECT
                f.`FILER_ID`,
                MAX(`id`) as `max_id`
            FROM FILERNAME_CD as f
            INNER JOIN tmp_other_filers as t
            ON f.`FILER_ID` = t.`filer_id`
            WHERE f.`FILER_TYPE` = 'RECIPIENT COMMITTEE'
            GROUP BY 1
        );
        """
        self.conn.execute(sql)
Another set of temporary tables that can't be created until the
dataset/ETHPy150Open california-civic-data-coalition/django-calaccess-campaign-browser/calaccess_campaign_browser/management/commands/loadcalaccesscampaignfilers.py/Command.create_temp_pac_tables