Eleni Markou shows a few techniques available to organize SQL queries, especially for analytics:
Jupyter Notebook
For the advocates of python, a commonly used application is Jupyter Notebook. Jupyter Notebook is a server-client application that allows editing and running of python code via a web browser combining python code, SQL, equations, text, and visualizations. It also offers syncing with GitHub repositories.
More specifically, Jupyter Notebook will be rendered by GitHub directly on your repo page. This means that one can enjoy all the benefits that Git offers regarding version control, branching, merging and collaborative development when using Jupyter Notebook.
The best strategy is probably a multi-tiered strategy. It absolutely starts with source control, but it doesn’t have to end there.