r/learnSQL • u/nighthaven • 10d ago
Really struggling with the concept of KEYS
I have been teaching myself SQL in Snowflake for about the past few weeks at work as it is now part of my job. I've been able to understand almost every part of the basics from SELECT to FROM to ORDER and other beginner things but those damned PRIMARY, HASH, and FOREIGN keys that are completely eluding my understanding.
I have access to the directory of all of our tables and whatnot, but when I see a HK or a HK_FK or am asked what a PRIMARY key is I freeze up because it's like I hit a mental block.
Is there an "Explain Like I'm 5" way of describing what keys are and how they're used? It will only help me in the end if there is a way.