Can you tell me how to filter the Customers table by State and City? Thank you
@app.route('/get-customers', methods=['GET', 'POST'])
def get_customers():
query = 'SELECT FirstName, LastName FROM customers WHERE City = "Oslo" or City = "Paris"'
records = execute_query(query)
result = '<br>'.join([str(record) for record in records])
return result
def execute_query(query):
db_path = os.path.join(os.getcwd(), 'chinook.db')
conn = sqlite3.connect(db_path)
cur = conn.cursor()
cur.execute(query)
record = cur.fetchall()
return record