Raw SQL
CREATE TABLE flights(
id serial PRIMARY KEY,
origin VARCHAR NOT NULL,
destination VARCHAR NOT NULL,
duration INTEGER NOT NULL
);
SqlAlchemy
db.create_all()
Raw SQL
INSERT INTO flights
(origin,destination,duration) VALUES ('NewYork','Paris',540);
SqlAlchemy
flight=Flight(origin="NewYork",destination="Paris",duration=540)
db.session.add(flight)