Campaign Finance Made Easy: Announcing 'DataTalk'
biglocalnews.org
biglocalnews.org
The prompt:
> How much money has Kamala Harris raised from CEOs for her 2024 presidential race?
The result:
> I attempted to execute a SQL query to find out how much money Kamala Harris has raised from CEOs for her 2024 presidential race. However, I encountered a permission issue that prevented me from accessing the necessary tables to retrieve the data.
SELECT cm."CAND_ID", cm."CAND_NAME", SUM(c."TRANSACTION_AMT") AS total_raised FROM "contributions_by_individuals_2023_2024" c JOIN "candidate_master_2023_2024" cm ON c."CMTE_ID" = cm."CAND_PCC" WHERE cm."CAND_NAME" = 'Harris, Kamala' AND (c."OCCUPATION" ILIKE '%CEO%' OR c."EMPLOYER" ILIKE '%CEO%') AND (LOWER(c."MEMO_TEXT")
NOT LIKE '%conduit%' OR c."MEMO_TEXT" IS NULL) GROUP BY cm."CAND_ID", cm."CAND_NAME";
> The SQL query is designed to calculate the total amount of money raised by Kamala Harris from individuals with the occupation or employer title containing 'CEO'. It joins the `contributions_by_individuals_2023_2024` table with the `candidate_master_2023_2024` table on the `CMTE_ID` and `CAND_PCC` fields to ensure the contributions are directed to Kamala Harris's campaign. The query filters out contributions that are conduited by a PAC to a candidate by excluding rows where the `MEMO_TEXT` contains 'conduit'. The query groups the results by `CAND_ID` and `CAND_NAME` to ensure the results are specific to Kamala Harris.