Question 4
Consider the following Python code.
app.py
from flask import Flaskfrom flask_sqlalchemy import SQLAlchemyimport os
app_dir = os.path.dirname(os.path.abspath(__file__))db_file = "sqlite:///course_database.sqlite3"
app = Flask(__name__)app.app_context().push()app.config["SQLALCHEMY_DATABASE_URI"] = db_fileapp.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db = SQLAlchemy(app)
class MaxScores(db.Model): __tablename__ = "max_scores" course_id = db.Column(db.String(10), nullable=False, primary_key=True) high_score = db.Column(db.Integer) term_year = db.Column(db.String(10))Using MaxScores data model in the above “app.py”. What is the correct sequence of python commands to insert MaxScores record?