Documentation Home
MySQL 9.3 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.8Mb
PDF (A4) - 40.9Mb
Man Pages (TGZ) - 261.1Kb
Man Pages (Zip) - 368.3Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb


22.4.4 Relational Tables

You can also use X DevAPI to work with relational tables. In MySQL, each relational table is associated with a particular storage engine. The examples in this section useInnoDB tables in theworld_x schema.

Confirm the Schema

To show the schema that is assigned to thedb global variable, issuedb.

mysql-py> db<Schema:world_x>

If the returned value is notSchema:world_x, set thedb variable as follows:

mysql-py> \use world_xSchema `world_x` accessible through db.

Show All Tables

To display all relational tables in theworld_x schema, use theget_tables() method on thedb object.

mysql-py> db.get_tables()[    <Table:city>,    <Table:country>,    <Table:countrylanguage>]

Basic Table Operations

Basic operations scoped by tables include:

Operation formDescription
db.name.insert()Theinsert() method inserts one or more records into the named table.
db.name.select()Theselect() method returns some or all records in the named table.
db.name.update()Theupdate() method updates records in the named table.
db.name.delete()Thedelete() method deletes one or more records from the named table.

Related Information