You've been given data on passengers of the Titanic in a SQLite file, and you want to create an API that will serve the data in a JSON format. You've created a bare-bones Flask app that connects to the SQLite database and serves a welcome page. Eventually, you will add two endpoints: one that returns a list of all passenger names, and a more detailed endpoint that returns a list of all passengers, including their name, age, and sex. But first, you need a reference to the passenger table in the SQLite database. from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine from flask import Flask, jsonify engine = create_engine("sqlite:///titanic.sqlite") Base automap_base() Base.prepare (engine, reflect=True) Passenger # MISSING CODE HERE app Flask (_name__) @app.route("/") def welcome(): """List all available api routes.""" return ( ) f"Available Routes: " f"/api/v1.0/names" f"/api/v1.0/passengers" if __name__ == '__main__': app.run(debug=True) On line 11, what does Passenger need to have assigned to it so that it will refer to the passenger table in the SQLite database? O passenger Base.classes.passenger sqlite:///titanic.sqlite/passengers Base.tables.passenger

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

please answer with proper explanation and step by step solution.

You've been given data on passengers of the Titanic in a SQLite file, and you want to create an API that will serve the data in a JSON format. You've created a
bare-bones Flask app that connects to the SQLite database and serves a welcome page. Eventually, you will add two endpoints: one that returns a list of all
passenger names, and a more detailed endpoint that returns a list of all passengers, including their name, age, and sex. But first, you need a reference to the
passenger table in the SQLite database.
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session.
from sqlalchemy import create_engine
from flask import Flask, jsonify
engine = create_engine("sqlite:///titanic.sqlite")
Base automap_base()
Base.prepare (engine, reflect=True)
Passenger = # MISSING CODE HERE
app Flask (_name_)
@app.route("/")
def welcome():
"""List all available api routes."""
return (
)
"Available Routes: <br/>"
f"/api/v1.0/names<br/>"
f"/api/v1.0/passengers"
if ___name__ == '__main__':
app.run(debug=True)
On line 11, what does Passenger need to have assigned to it so that it will refer to the passenger table in the SQLite database?
O passenger
Base.classes.passenger
sqlite:///titanic.sqlite/passengers
Base.tables. passenger
Transcribed Image Text:You've been given data on passengers of the Titanic in a SQLite file, and you want to create an API that will serve the data in a JSON format. You've created a bare-bones Flask app that connects to the SQLite database and serves a welcome page. Eventually, you will add two endpoints: one that returns a list of all passenger names, and a more detailed endpoint that returns a list of all passengers, including their name, age, and sex. But first, you need a reference to the passenger table in the SQLite database. from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session. from sqlalchemy import create_engine from flask import Flask, jsonify engine = create_engine("sqlite:///titanic.sqlite") Base automap_base() Base.prepare (engine, reflect=True) Passenger = # MISSING CODE HERE app Flask (_name_) @app.route("/") def welcome(): """List all available api routes.""" return ( ) "Available Routes: <br/>" f"/api/v1.0/names<br/>" f"/api/v1.0/passengers" if ___name__ == '__main__': app.run(debug=True) On line 11, what does Passenger need to have assigned to it so that it will refer to the passenger table in the SQLite database? O passenger Base.classes.passenger sqlite:///titanic.sqlite/passengers Base.tables. passenger
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Procedures in SQL
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education