Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think you need a visual model that works for you to approach it since they're entirely different beasts. You'll hit a wall very soon if you approach learning SQL in terms of C++/C#.

CSS is a similar phenomenon, you can't approach it as code. The box model is a nice way to get the basics and manipulate the DOM.

Similarly, I think in terms of tables (rows and columns) to visualize SQL operations that I need to do. Every operation is like a matrix operation, so you need to stop thinking in terms of for/loops iterators and think of matrix/table wide operators. Once you've got the basics, then you can look at stuff like window functions to do more advanced operations.

Takes a bit of working with to get used to. That's just how I think about it - you'll need to find a metaphor that works for you!



I sometimes mention declarative vs imperative when talking about software development, especially to people who are coming from a HTML/CSS background. I'll give some details below in case it is useful.

Declarative languages encompass things like HTML, CSS, and SQL. Here we say what should happen, but not specifically how it should happen.

Imperative languages are C, Python, Java, JS etc. Here we give the precise steps which describe how something should work, and there is an absence of describing what the problem actually is.

Declarative languages give us a lot of power to solve a very narrow range of tasks.

Imperative languages give us comparatively less power, but allow us to tackle a very wide range of tasks.

For example: We could certainly write a Python program to sort, filter, group, and join two lists of data. However, the equivalent SQL code would be much shorter and – all things being equal – much more readable.

Conversely, SQL would be a non-starter for writing a web service or an image processing library. SQL does one thing really well, and that thing is data wrangling.


> CSS is a similar phenomenon, you can't approach it as code.

Mozilla put out a good video about this today: https://www.youtube.com/watch?v=aHUtMbJw8iA




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: