Tables, Views, and Files
Create a Table
Description
The get_table()
and create_table()
functions let you save either an existing table or a newly created table into a variable.
Syntax
Use the get_table()
method to fetch a table from the mysql_demo_db
database:
my_table = mysql_demo_db.get_table('my_table')
Or, the create_table()
method to create a new table:
# option 1
my_table = mysql_demo_db.create_table('my_table', 'SELECT * FROM some_table WHERE key=value')
# option 2
my_table = mysql_demo_db.create_table('my_table', base_table)
# option 3
my_table = mysql_demo_db.create_table('my_table', base_table.filter(key='value'))
Was this page helpful?