How would I combine the following two statements to create a valid SQL query?
provider = os.path.basename(file)
cursor.execute("""INSERT into main_app_financialstatements
(statement_id, provider_id***, url, date)
VALUES (%s, %s***, %s, %s)""",
(statement_id, provider***, url, date))
provider_id = SELECT id FROM main_app_provider WHERE provider=provider
In other words, I have the provider, and I need to SELECT the provider_id from another table in order to INSERT it into the main_app_financialstatements.