execute immediate to make creation of many very similar tables easier.
A little PL/SQL demo:
ctas_sql:='select sysdate as foo from dual';
for table_number in 1..10
execute immediate('create table foo'||table_number ||' as ('||ctas_sql||')');
PL/SQL procedure successfully completed.
SQL> select table_name from user_tables;
10 rows selected.
The create table statement can contain anything you want - the above is just showing that the statement can be dynamic. So, in your case you'd have simple logic to alter the
TEAM_ID and table name for each statement.
Bind variables will offer no gain unless you're executing the same single query multiple times (extremely simplified for the sake of this answer) - in this case you're executing many different queries that are performing large bulk inserts.
Creating tables with
NOLOGGING is not advisable if this is a production system. Also be aware that not logging and
/*+APPEND*/ can have backup/restore implications. This Ask Tom thread may be of particular interest.
To clarify, using CTAS is the way to go. You only have to parse the CTAS statement once to insert your millions of rows. If you use individual INSERT statements you have to parse each statement over & over again, which adds a massive overhead!