The “Scratches and Consoles” feature of DataGrip specifically, but I think JetBrains does this in all their IDEs, is super nice. From a SQL perspective this is especially nice since the majority of time you run random adhoc queries.
I was playing with AWS Athena a year or two ago. I have a scratch file of my queries and me playing around with ETL. No need to worry about source control, that is for formal things like Flyway scripts.