News for hackers. Stuff that matters.
Re:Unreasonable Effectiveness of SQL by smnrchrds on Thursday April 04, 2019 @03:28PM (#19576192)
I have always used RDBMS through an ORM, usually Django's. I understand basic SQL syntax, but nothing beyond that, and I cannot think in SQL if that makes sense. Is there a good book or course for someone like me to dive into SQL, preferably Postgres?
Re:Unreasonable Effectiveness of SQL by em500 on Thursday April 04, 2019 @06:39PM (#19577803)
Re:Unreasonable Effectiveness of SQL by paddy_m on Thursday April 04, 2019 @04:05PM (#19576531)
Phillip Greenspun occasionally (every couple of years) teaches a 3 day deep dive on SQL at MIT. It's free and open to everyone. I have gone to TA the class twice and I learned a bunch walking students through the exercises. Highly recommended.
Re:Unreasonable Effectiveness of SQL by sammorrowdrums on Thursday April 04, 2019 @03:32PM (#19576236)
This course is a wonderful start

https://lagunita.stanford.edu/courses/DB/2014/SelfPaced/abou...

After this I would have a look at the postgres documentation. There's so many great examples between there and stack overflow.

Re:Unreasonable Effectiveness of SQL by smnrchrds on Thursday April 04, 2019 @03:36PM (#19576272)
This brings back memories. I remember going through the course many years ago, but I got busy with other projects and quit about 25% through. I'm glad it is still out there and still considered a good source.
Re:Unreasonable Effectiveness of SQL by sammorrowdrums on Thursday April 04, 2019 @03:45PM (#19576358)
Yeah if you've gone through a good chunk maybe complete it.

I really hate knowing how easy it is to do some queries and struggling to use the Django ORM to achieve what I could write in minutes - but for maintainability I hate dropping down to SQL in that context.

For a fun advanced tutorial, have a go at pivot tables with crosstab using the docs. I've used it for analytics queries to chart categories as headings, with complex aggregations etc.

https://www.postgresql.org/docs/9.1/tablefunc.html

Window functions are another classic

https://www.postgresql.org/docs/9.1/tutorial-window.html

In general working with SQL and gradually solving the problems you have learning as you go is excellent. If you want faster than that there probably are courses but I really do rate their docs. Postgres is great.

Re:Unreasonable Effectiveness of SQL by cagmz on Saturday April 06, 2019 @10:11AM (#19590797)
I had the same issue and can highly recommend this course: https://classroom.udacity.com/courses/ud198

It includes short videos, quizzes, articles, and exercises.