engine = db.create_engine('sqlite:///datacamp.sqlite') conn = engine.connect() metadata = db.MetaData() Student = db.Table('Student', metadata, db.Column('Id', db.Integer(),primary_key=True), db.Column('Name', db.String(255), nullable=False), db.Column('Major', db.String(255), default="Math"), db.Column('Pass', db.Boolean(), default=True) ) metadata.create_all(engine)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter