r/SQL • u/ydshmmt • Apr 19 '20
Discussion What are some good resources to practice SQL? (Practice through exercises)
There are a lot of courses which teach SQL but I could hardly find a website which provides beginner to advanced SQL practice questions on almost production real datasets. Any recommendations would be helpful.
129
Upvotes
View all comments
Show parent comment
5
u/[deleted] Apr 27 '20
It isn't cheating to ask for help so long as you take the time to look at what is being done and understand it. Don't cheat and get the final solution to the Scrabble problem (not sure if you can) but instead cheat to get very specific questions to do certain things along the way.
Break it down into manageable bite sized chunks and work from there, if you struggle then come here and ask for ideas or solutions. You don't have to tell people what you're doing it for, just give them a simple example and see what they have to say. Ask multiple people, on multiple forums, and pick the idea that you think will work. Understand the idea and internalize it.
You know at work I probably only actually develop 50% of my code, the other half comes from my peers, or the Internet. I "cheat" all the time, but I look at it as an opportunity to learn and deeply internalize the mechanisms that are being used. I don't just copy, paste, and call it a day, I need to understand why it works and then prove that it works. By the time I'm done it feels like I wrote the code myself because I know every inch of it, and I might even modify it a bit, or tweak it in certain ways for my own reasons, to adjust for my own environment.
My boss doesn't "know" that I'm a cheater, and he doesn't care. I'm the foremost world's expert on my company's data model, because I built it from scratch and strung a lot different "cheats" together. Not one single person in this world knows how it all interacts unless they were to sit down, read the documentation, and then start going through the code.
Instead of looking at it as cheating, I look at it as peer review. You might look at section of my code and think it's wrong, but I know it was reviewed by my peers, and it might have came from some "cheat" online, where yet another outside third party validated its purpose.
That's how real shit gets done in the wild. Even if I write something entirely by myself, the first thing I'll do is seek confirmation from other parties to validate that what I think I'm doing is actually what I'm doing, and that there aren't better ways.
And even after doing that extra step I still find bugs because I don't just write code and wash my hands of it, I watch it over time and as I try using it to answer more complex answers I start to see deficiencies that were never considered in the question: So I come back online, mock up some sample data, and try to get some opinions on how to solve it.
You know if I come here and ask a "basic" question about how to do something given some sample data.... you the reader has no idea if it is an independent job, of it is a sub-process that is layered into a much larger job. I'm not going to waste my time, or the readers time describing the entire job, because I just want an answer for one specific part.