Aside from a specification of default values for fields, and which fields are required, this is a simple way to declare the tables:
db.define_table('product',
Field('quantity_in_store', 'integer'),
Field('price', 'float'),
Field('quantity_in_order', 'integer'),
Field('supplier', 'reference supplier')
)
db.define_table('supplier',
Field('name', 'string'),
Field('address', 'string'),
Field('phone', 'string'),
)
db.define_table('contact',
Field('supplier_id', 'reference supplier'),
Field('name', 'string'),
Field('email', 'string'),
Field('phone', 'string'),
Field('note', 'text')
)
db.define_table('customer',
Field('name', 'string'),
Field('phone', 'string')
Field('email', 'string'),
)
db.define_table('purchase',
Field('product', 'reference product'),
Field('customer', 'reference customer'),
Field('price', 'float'),
Field('date', 'datetime')
)