Best way to learn SQL from scratch?

I am a Business Analyst and believe it or not in my career I have never had the need to use SQL to query databases and pull out data in order to manipulate it and do data analysis. I have a project coming up that will require me to do some user usage stats and this means pulling data/stats from our SQL database. I want to learn how to do this and want to it it to my skill set...

You should ask your DBA how the data will be made available to you. We only allow limited permissions to our data. Also make sure you understand how the data is structured. I often find people get the wrong data because they don't understand how the data is structured. So at reports from from unit differ from old reports, or reports done by another person.
 
This is where I would like to end up being. I've been using SQL for 5+ years now and I love sitting and writing queries. I've not moved into a SQL specific role yet as I feel I have more learning to do - of which I don't feel compelled to do after work as my days are long!

Nice to see some resources being posted though, will be useful for sure!

I've been using it for 6 months, and basic select, replace, insert jobs. Nothing taxing really. This place employed me on my attitude not on SQL ability. SQL can be learnt, attitude can't be.

Apply, see what happens :) Worst that happens is you stay where you've been for 5 years, best case is you end up in a role doing what you want :)
 
I've been using it for 6 months, and basic select, replace, insert jobs. Nothing taxing really. This place employed me on my attitude not on SQL ability. SQL can be learnt, attitude can't be.

Apply, see what happens :) Worst that happens is you stay where you've been for 5 years, best case is you end up in a role doing what you want :)

Its worth doing these online courses as it will save you a lot of time in the long run. I would start with those.

Not to hijack (sorry OP) but I'm fairly competent if I'm honest. SELECT, JOIN(S), ALTER, COUNT, BEGIN TRANS/COMMIT etc...used daily and easy enough to do. My biggest issue atm is the size and complexity of our dataset so that can slow me down - i honestly love it!
 
Not to hijack (sorry OP) but I'm fairly competent if I'm honest. SELECT, JOIN(S), ALTER, COUNT, BEGIN TRANS/COMMIT etc...used daily and easy enough to do. My biggest issue atm is the size and complexity of our dataset so that can slow me down - i honestly love it!

I've just started touching the SQL in the new job, WOW! MIND ****!

Must be 50 different databases for production, 50 more for test, and that's just for the one service we provide, there's 5 or 6 more.

I was given a list of sample questions to help me figure it out, working with another lad who has been there 5 weeks. Thank god for the EDM showing what links with what. The lad is better at the code than me, but I was figuring out the relationships and tables to use better than him in some cases.

Massive learning curve. 2nd line there have been working there 5+ years before being moved up. Some 3+ years are still learning the systems.

EDIT: There's also some good SQL courses here: https://www.edx.org/
 
I've just started touching the SQL in the new job, WOW! MIND ****!

Must be 50 different databases for production, 50 more for test, and that's just for the one service we provide, there's 5 or 6 more.

I was given a list of sample questions to help me figure it out, working with another lad who has been there 5 weeks. Thank god for the EDM showing what links with what. The lad is better at the code than me, but I was figuring out the relationships and tables to use better than him in some cases.

Massive learning curve. 2nd line there have been working there 5+ years before being moved up. Some 3+ years are still learning the systems.

EDIT: There's also some good SQL courses here: https://www.edx.org/
The code is the relatively easy bit as there's so many resources out there to look bits up from, learning the data is the difficult bit so if you're getting that nailed already then you're flying.
 
This day and age you should really be using nvarchar/nchar instead of varchar/char... Unicode data is all over the place and we are seeing it happen more and more.. If you want to use a varchar/char just use nvarchar/nchar in its place.
Not normally necessary in Oracle databases. If you set your database character set appropriately then varchar2 will handle Unicode. NVARCHAR is only needed if you want to store some unicode, but your character set doesn't support it, which would be... unusual. Just remember to change the semantics from BYTE to CHAR because Oracle apparently believes we're still in the 1980s.
 
Not normally necessary in Oracle databases. If you set your database character set appropriately then varchar2 will handle Unicode. NVARCHAR is only needed if you want to store some unicode, but your character set doesn't support it, which would be... unusual. Just remember to change the semantics from BYTE to CHAR because Oracle apparently believes we're still in the 1980s.

Sorry, should have specified that this is for T-SQl/MS Sql implementations. :)
 
For anyone currently in a SQL position job, any chance you can give a couple of examples of the work you do in SQL? What would a general business task be to search in SQL?

For example, the course I'm currently doing provides different tasks to complete, like find out name of a costumer from customer ID. Or find the top 5 customer who spent the most money on rentals.
 
For anyone currently in a SQL position job, any chance you can give a couple of examples of the work you do in SQL? What would a general business task be to search in SQL?

I'm currently trying to reconcile 2 different databases to identify common data, differences, duplications, etc between them.
 
For anyone currently in a SQL position job, any chance you can give a couple of examples of the work you do in SQL? What would a general business task be to search in SQL?

For example, the course I'm currently doing provides different tasks to complete, like find out name of a costumer from customer ID. Or find the top 5 customer who spent the most money on rentals.

My last role was a case of transferring orders from one person when they left to another person still in the company and doing a basic INSERT command to add new row into the table we used to track business partners, and maybe updates when I put the phone number in with a space and wanted to keep the standard the same.

This new job, complete step up. A lot of it so far is running reports and investigating issues. 50-60 client client databases, the same number of testing databases, each one with 40+ tables, web front ends, 4 different products using the databases, 24 hour coverage, worldwide clients etc. MASSIVE step up in size and complexity over the last job.

As i've only been there a month it's things such as taking sanction lists and importing them, subject access requests on individuals, monitoring software updates etc. SQL and T-SQL

I've borrowed 2 books from the company library, Head First SQL and SQL Practice Problems. Using free software and free sample databases. it's good practice.

It sounds like the work you are currently doing is looking at the relationships between tables and data, ERD's are great for seeing how tables interact, the different keys in them. Definitely helped me out. that's what most jobs are, understanding how the tables interact with each other to get the information you require.

I would also look at Joins for joining tables together and using TRANS for updates, really helps in case you make mistakes.
 
For anyone currently in a SQL position job, any chance you can give a couple of examples of the work you do in SQL? What would a general business task be to search in SQL?

For example, the course I'm currently doing provides different tasks to complete, like find out name of a costumer from customer ID. Or find the top 5 customer who spent the most money on rentals.

I work for a digital media publisher in their operations team and we use it for a tonne of ad related stuff. Cleaning up raw server logs into something useful or matching UserIds to the user's historic behaviour from all sorts of different data sources, defining the aggregated behaviours (for example, declared to be x, subscribes to y, reads z) and putting the users into groups together to create audience segments to target ads against are probably one of my more complex of use cases. But even then, all I am doing is using the same logic and same sorts of operators as that which is being used for the simple queries in these courses and building it up.

I have used SQLBolt and found it great, gives you some lessons and then a test at the end so that you can put into practice what you have just learnt.

also found w3schools https://www.w3schools.com/sql/default.asp to be really good

This is what I used to start out with. I recommend it.
 
I am a Business Analyst and believe it or not in my career I have never had the need to use SQL to query databases and pull out data in order to manipulate it and do data analysis. I have a project coming up that will require me to do some user usage stats and this means pulling data/stats from our SQL database. I want to learn how to do this and want to it it to my skill set.

Now I know I can go and watch YouTube videos and such like but its where is the best place to start. Speaking with colleagues in the office I've been advised to pick a topic I am interested in and build a project from there. I love my music and like to Dj in my spare time so I was thinking I could export al;l my music tracks and build some sort of database to then query. My question is what is the best way to go about this and learn SQL from the ground up?

After that I need to move on to how to use excel to manipulate data, using functions like vlookup and picot tables, so any suggestions on that would also be appreciated.

Thanks!

Hi, I wonder how you got on being a newbie and what methods/courses/training you found best to get to where you are now?
I am a warehouse manager but taking on the SQL reporting for the business; I have zero experience but am very willing to learn.
 
A developer edition of SQL is now free, so you have no excuse not to install it at home and start learning today.. And knowing how to setup a database and doing basic server admin stuff is useful. Your day job may not directly call for it (yet), but its very very useful to have the foundations and to understand where the data goes, why certain design choices might have been made etc.

Which developer edition do you refer to please?
 
Glad i came across this thread, i need to learn sql for local job vacancies. Looking for the a recognosed qualification (pref 3-6 months)
There aren't any that I'm aware of, SQL is one of those things you go on a week long course for at most and then learn on the job.
 
Back
Top Bottom