Best way to get started with SQL?
I started programming almost year ago and I still very much enjoy it that I've considered to turn it into a career (even though I'm approaching 30 now). Anyways, 80% of the jobs seem to be requiring knowledge of SQL and relational databases.
Now my skills are still somewhat basic but I'm accustomed to the learning process. I've gone through Learn Python The Hard Way, created my first little program and now crunching through Swift book - so there you go.
My only experience with SQL was using MySQL interface when setting up Wordpress installations. I'm looking for something that is approachable with lots of good examples and possibly exercises.
Is there a good book, youtube channel or course (Udemy) that I should look at? Mind you I'm pretty serious about it so I don't really mind spending some money (less than $100 though) but if there is good free material, even better! I've had somewhat positive/negative relationship toward Youtube tuts - I found one that was great for Tkinter framework but for Django I had to go through a book to understand it properly.
Thank you!
7 comments
[ 3.7 ms ] story [ 30.6 ms ] threadThat'll give you some understanding of the richness that's available to you when you start to use SQL. Until you get why SQL is amazing, SQL will feel like a chore.
Once you feel comfortable with custom reports, you should learn about performing queries on queries (via subqueries, CTEs or views ... all very similiar) and queries between tables (JOINs).
Once you have JOINs and subqueries down, you'll be able to do things that are both blazing fast (compared to similiar operations in your application) and extremely memory efficient.
Search for elections results, weather/climate change, air pollution, crime rate - there's a lot of it online.
If you want working with SQL to become extremely easy to you, you will need to start creating websites, bring traffic to those sites and implement the scaling procedures you have learned from the books below.
As if you go to a job interview and want to blow it out of the water it is to your best advantage to know for example MySQL in and out so well you make the interviewer smile inside and go yes we have found the one. You will probably see a little smirk as the interviewer is trying to hold in their smile when this happens but you will know when this occurs very easily. Upside to this is you will be very comfortable getting started on day one and the only training you will need is the current architecture and backup or non existent backup plans in place so you can get to work.
I recommend the following hardcopy books in order:
MySQL: http://www.amazon.com/MySQL-Developers-Library-Paul-DuBois-e...
www.amazon.com/High-Performance-MySQL-Optimization-Replication/dp/1449314287/
http://www.amazon.com/MySQL-High-Availability-Building-Cente...
If your wanting to do Microsoft SQL Server, I recommend the following: http://www.amazon.com/Microsoft-Server-2012-Step-Developer/d...
http://www.amazon.com/Training-70-461-Querying-Microsoft-Ser...
http://www.amazon.com/Training-70-462-Administering-Microsof...
Part One gives a really good overview of writing queries for mysql, optimizing them, understanding all the data types etc.
Part Two gives you the practical hand on that you need in multiple programming languages C, Perl, and PHP.
Part Three teaches you administration and security which helps complete the circle of knowledge. As you don't want to be a developer that does not know how to talk the Database administrator language. As the more you know and learn the better you and others can help optimize and secure the different development, staging and production environments applications and hardware.
To my point: make sure you learn how to do complex SQL queries including subqueries and correlated subqueries. Also, learn to create stored procedures and triggers in your favorite database.
You might look into the book "Refactoring Databases" by Ambler and Sadalage. It challenges you to think about the database as an evolving system, which is different than the kind of textbook exercises where you just sketch or build it once and then move on to the next problem.
Install MySQL on your machine to play with. If you have access to a Wordpress install that has some data in it, take a backup of that and restore it to your machine and learn how to write queries for it. The way to figure out what to query is ask yourself questions, like, how many blog posts were posted in the past year. What was the count of blog posts per month for the past year. Stuff like that. And anything that you could see someone asking you to answer. BTW -- I am not suggesting that Wordpress is an amazing database design, but it is fairly typical of what people do so its a reasonable place to learn.
Then once you feel pretty comfortable there, take a couple of the public datasets you can find online, Amazon shares a bunch of them and you can find others. Then create a database, import the data and write queries against it, following the same process of asking questions that seem interesting. You can even take the max-mind CSV file they provide and create a database out of that to learn how to query it and get answers. It is a small and simple dataset but there are a number of things you can figure out using it.
While I personally prefer postgres, I think MySQL is probably a good place to learn as there are a ton of tutorials and resources for it. After you master the concepts then you can switch between platforms much easier, MS SQL, MySQL etc. The basics are the same between them all, even though each has their own quirks and gotcha's, knowing how to work in one you can always ask Google how to do X in Y if you already know how to do X.