Question: ```py
@app.route('/')
def index():
    return render_template("home.html")

```

My folder structure looks like this

```
tree-/
   -static/
      -styles.css
   -templates/
      -home.html
   -app.py

```

I get

**Not Found**

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

On the browser and

```
127.0.0.1 - - [01/May/2021 09:41:47] "GET / HTTP/1.1" 404 -

```

In the debugger

Have looked at other related posts saying stuff about trailing slashes and it doesn't look like its making a difference, either I access
<http://127.0.0.1:5000>
or
<http://127.0.0.1:5000/>

I run my application using

```py
app = Flask(__name__)

if __name__ == '__main__':
    app.run()

```

I get

```py
 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

```

```py
from flask import Flask, redirect, url_for, render_template

app = Flask(__name__)

if __name__ == '__main__':
    app.run()

@app.route('/')
def index():
    return "Hello World"

```

Answer: 
```
SELECT DISTINCT Customer_ID
FROM table t1
JOIN table t2 USING (Customer_ID)
WHERE t1.Location = 'Santa Clara'
  AND t2.Location = 'Milpitas'
  AND t1.Store_Entry > t2.Store_Entry

```
Query For mySQL 8.0

```
WITH cte AS (
    SELECT *, LEAD(region) OVER (PARTITION BY customer_id ORDER BY customer_id, store_entry) AS next_region
    FROM tour_tab
)
SELECT customer_id
FROM cte
WHERE region=5 AND next_region=2 /* 'Santa Clara' AND 'Milpitas' */

```