Hello, thanks for reading this article.
"select * .." and all other SQL-related code can only be run in an SQL console, and they're not Python code, so you can't run it in a Notebook or Python console.
The other article may help you get started with SQL using sqlite in Python: https://towardsdatascience.com/from-sqlite-to-pandas-7-essential-operations-you-need-to-know-c7a5dd71f232.