Raw SQL for creating test data ported to Python