Lingkarkan melalui panda Groupby
grouped = df.groupby('group')
for group_name, group in grouped:
print('\nCREATE TABLE {}('.format(group_name))
print(group["column"])
Outrageous Octopus