Best way to learn SQL from scratch?

Soldato
Joined
27 Jul 2007
Posts
6,192
Soldato
Joined
8 Nov 2002
Posts
3,422
Location
Near Bristol, Uk
Soldato
Joined
6 Mar 2008
Posts
10,079
Location
Stoke area
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.

Yep, I work in a team of 30 analysts and I don't think any of us have a qualification based around SQL, I knew basic update etc when I started.
 
Associate
Joined
24 Mar 2011
Posts
306
Location
Sherwood Forest
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.
Hmm.. What would my best approach be if i wanted to get to an sql interview? I have a more skilled IT role, fine with data (the output of queries), but all vacancies require a couple of years on the job experience
 
Associate
Joined
24 Mar 2011
Posts
306
Location
Sherwood Forest
Man of Honour
Joined
26 Dec 2003
Posts
31,084
Location
Shropshire
Hmm.. What would my best approach be if i wanted to get to an sql interview? I have a more skilled IT role, fine with data (the output of queries), but all vacancies require a couple of years on the job experience

Unfortunately if they specify on the job experience then even a recognised qualification probably won't really help as you'll still be lost in the first paper sift.

Can you not try and work it into your current role if you're already working with data? You can use it in things like Excel.
 
Associate
Joined
24 Mar 2011
Posts
306
Location
Sherwood Forest
Unfortunately if they specify on the job experience then even a recognised qualification probably won't really help as you'll still be lost in the first paper sift.

Can you not try and work it into your current role if you're already working with data? You can use it in things like Excel.

My current role doesnt have access to what i need. Ive some thinking to do
 
Soldato
Joined
17 Aug 2003
Posts
20,158
Location
Woburn Sand Dunes
Associate
Joined
4 Jan 2010
Posts
603
The problem I see with not having experience of SQL work history is that you will be quickly found out with theoretically workable SQL answers that can be found in textbooks but are not always applied in the same way in industry. These are the topics below I think you should understand how they are used in industry first :

* left vs right joins (never use right)
* Union all vs Union joins
* views vs stored procs (answers may vary depending on database)
* reusable user defined functions
* ctes vs tables
* understanding query/execution plans
* using variables and choosing the correct data type
* nulls

I suggest that you at least understand the above fundamentals first and how to write scalable sql solutions before attempting to justify the lack of work history. Nearly all the DB jobs I have been to in the past have questions of performance and best practices where the answer is always 'it depends'

Regards,
 
Associate
Joined
24 Mar 2011
Posts
306
Location
Sherwood Forest
The problem I see with not having experience of SQL work history is that you will be quickly found out with theoretically workable SQL answers that can be found in textbooks but are not always applied in the same way in industry. These are the topics below I think you should understand how they are used in industry first :

* left vs right joins (never use right)
* Union all vs Union joins
* views vs stored procs (answers may vary depending on database)
* reusable user defined functions
* ctes vs tables
* understanding query/execution plans
* using variables and choosing the correct data type
* nulls

I suggest that you at least understand the above fundamentals first and how to write scalable sql solutions before attempting to justify the lack of work history. Nearly all the DB jobs I have been to in the past have questions of performance and best practices where the answer is always 'it depends'

Regards,
Thanks for the above information, very useful keywords for me to look into.

I do agree that theory and industry are very rarely synced, for any field
 
Man of Honour
Joined
17 Oct 2002
Posts
50,385
Location
Plymouth
Thanks for the above information, very useful keywords for me to look into.

I do agree that theory and industry are very rarely synced, for any field

I'd also add learning the differences between oltp and olap databases, when they used in industry and why, and make sure you focus on the right type for the type of jobs you are looking for, and start to spread your learnings once you do.
 
Associate
Joined
26 Aug 2011
Posts
192
I would suggest following all the advice in this thread but also, you need to know that in production, most databases are NOT in any way perfect. There will be useless data, there will be tables with no keys, no indexes, no thought about relationships with other tables, incorrect data types, etc. You will find horrible code in stored procedures, badly performing queries, parameter sniffing and many other things that could be avoided if people simply followed best practice and took some time to learn and apply their knowledge. Not to put you off but be aware that most businesses use databases heavily yet employ very little effort in maintaining some form of order. Database analysts (in my experience at several companies) are good at running jobs and occasionally suggesting you add an index, but often fall foul of many things themselves. We're only human but we can do better!
 
Soldato
Joined
6 Mar 2008
Posts
10,079
Location
Stoke area
I would suggest following all the advice in this thread but also, you need to know that in production, most databases are NOT in any way perfect. There will be useless data, there will be tables with no keys, no indexes, no thought about relationships with other tables, incorrect data types, etc. You will find horrible code in stored procedures, badly performing queries, parameter sniffing and many other things that could be avoided if people simply followed best practice and took some time to learn and apply their knowledge. Not to put you off but be aware that most businesses use databases heavily yet employ very little effort in maintaining some form of order. Database analysts (in my experience at several companies) are good at running jobs and occasionally suggesting you add an index, but often fall foul of many things themselves. We're only human but we can do better!

We've just deleted 40 million rows of data from a single table on one of our 60+ clients databases, all useless data :D

We've had issues with long and short date types as well where a job runs at a set time but was missing the first minute of rows that had been entered due to time issues.


I'd also add learning the differences between oltp and olap databases, when they used in industry and why, and make sure you focus on the right type for the type of jobs you are looking for, and start to spread your learnings once you do.

2 years in a TSQL based analyst role as that's the first time I've heard those terms.
 
Associate
Joined
19 Feb 2009
Posts
135
Location
Birmingham
Thanks for this thread. I was looking for resources to learn SQL as I could do with having more skills when job hunting. What is the normal cost for a microsoft certification? Are there any free certificates?
 
Soldato
Joined
6 Mar 2008
Posts
10,079
Location
Stoke area
Thanks for this thread. I was looking for resources to learn SQL as I could do with having more skills when job hunting. What is the normal cost for a microsoft certification? Are there any free certificates?

Honestly, I work with 30 analysts, none of which have any SQL specific qualifications.

The best thing to do is download some free software such as SSMS, get some sample databases and just start practicing.

You may get an ERD for the database which shows the tables, keys and the relationships between the tables. This will help you when querying multiple tables.

Learn simple selects, joins first. Learn to put things in transactions for anything that makes changes. A transaction makes the change a temp one until you commit it:

BEGIN TRAN

SQL QUERY THAT CHANGES DATA

-- ROLLBACK
-- COMMIT
PRINT @@TRANCOUNT

-- is a comment
rollback will roll back the change you've just made
commit commits the change
the print shows how many open transactions you have open

Personally, we use Transact SQL (TSQL) at work, there's a few different types so worth seeing what's out there.
 
Permabanned
Joined
9 Aug 2008
Posts
35,707
I did a little bit of MYSQL, PHPMYADMIN and PHP pulling and pushing data from websites.

I managed to be able to have a webpage, add data, delete it, and modify it.

that was a little project for myself but never implemented anything live.

I used YouTube tutorials to learn.
 
Associate
Joined
16 Jun 2008
Posts
1,281
I've not come across anywhere specifically asking for a certification but a lot of places that ask for experience with SQL will have some sort of test at interview - it's quite easy to get an idea of the candidate's knowledge.
 
Back
Top Bottom