I think you're referring to "bicycle skills" [1], that is, skills that you need to pre-learn so that you can call upon them when you need to. (like knowing how to ride a bike on vacation -- you can't learn it on the spot, so you would have needed to have pre-learned it. Swimming is another skill in the same ilk. Languages is another.).
For a lot of programmers, SQL is such a skill. Most programmers suck at SQL because they don't use SQL often enough so they forget the syntax and have to recall it from scratch each time they need it. It's a hidden disability in the software development world.
The answer is that you have to have learned the skill up to a certain level of proficiency before letting it go. You cannot get there by dabbling each time. There's a minimum threshold after which the skill doesn't simply evaporate from memory and recall is fast. But it takes a certain investment of time and effort.
For a lot of programmers, SQL is such a skill. Most programmers suck at SQL because they don't use SQL often enough so they forget the syntax and have to recall it from scratch each time they need it. It's a hidden disability in the software development world.
The answer is that you have to have learned the skill up to a certain level of proficiency before letting it go. You cannot get there by dabbling each time. There's a minimum threshold after which the skill doesn't simply evaporate from memory and recall is fast. But it takes a certain investment of time and effort.
[1] https://www.johndcook.com/blog/2012/08/01/bicycle-skills/