Developer or DBA – Who makes the most?

developer or DBA

My last newsletter was focussed on a salary survey that was taken back in January. You can see that post here. We’ll use the same data set in this post. In this post we will look at the data, try and look at what the different types of data professional jobs are, and what people working in those jobs currently earn. Again, this might affect any decision you might make when choosing a career. Developer or DBA – Who makes the most? I have seen people describe and compare the relationship between DBA and developer to that of cat and dog. They can argue a lot and don’t always get on…I was intrigued to look at differences in salary between the two groups…to see if salary differences might add to he tension that can sometimes exist between the two groups. I don’t think, prior to writing this post and the queries that analyse the data that there will be a huge gulf between the two job roles…with that said, I haven’t looked at the data yet and might just be surprised.

Who earns more a DBA or Developer?

The job title field in the salary survey appears to be a free text field. This allows for some discrepancies.  People can put want they want in that field. In order to pull out all the developers, DBAs and other job titles I need to introduce a WHERE clause and also use LIKE to do a wild card search. The first query below allow me to search  for a job title that contains the string ‘dev.’ I’m marking the results with an extra attribute, which is a literal string,  called ‘developer’ in result set so I know that the row came from my find a developer query.

SELECT

‘Developer’ as JobTitle

,COUNT(*) NoOfReplies

,AVG (SalaryUSD) AvgSalary

,MAX (SalaryUSD) MaxSal

,MIN(SalaryUSD) MinSal

FROM [dbo].[SalarySurvey]

where JobTitle like ‘%dev%’If they have dev in the job title

I’ll use a similar query to extract the same values for  DBAs except I have replaced the LIKE clause looking for the string ‘DBA’ and I have changed the literal in the result set to say DBA too.

SELECT

‘DBA’ as JobTitle

,COUNT(*) NoOfReplies

,AVG (SalaryUSD) AvgSalary

,MAX (SalaryUSD) MaxSal

,MIN(SalaryUSD) MinSal

FROM [dbo].[SalarySurvey]

where JobTitle like ‘%DBA%’If they have DBA in the job title

For everyone else I need a slightly different WHERE clause – I want to remove all the rows where the job title has ‘Dev’ or ‘DBA’ in it. So I’ll use two WHERE conditions that use not like and I’ll combine them together with an AND statement. I’ll give this result set the classification of ‘other’.

SELECT

‘Other’ as JobTitle

,COUNT(*) NoOfReplies

,AVG (SalaryUSD) AvgSalary

,MAX (SalaryUSD) MaxSal

,MIN(SalaryUSD) MinSal

FROM [dbo].[SalarySurvey]

where JobTitle NOT like ‘%DBA%’If they have DBA in the job title

AND JobTitle NOT like‘%Dev%’If they have DBA in the job title

Order by AvgSalary desc

I’m going to combine all of these queries with a UNION ALL to give us the final result.

SELECT

‘Developer’ as JobTitle

,COUNT(*) NoOfReplies

,AVG (SalaryUSD) AvgSalary

,MAX (SalaryUSD) MaxSal

,MIN(SalaryUSD) MinSal

FROM [dbo].[SalarySurvey]

where JobTitle like ‘%dev%’If they have dev in the job title

UNION ALL

SELECT

‘DBA’ as JobTitle

,COUNT(*) NoOfReplies

,AVG (SalaryUSD) AvgSalary

,MAX (SalaryUSD) MaxSal

,MIN(SalaryUSD) MinSal

FROM [dbo].[SalarySurvey]

where JobTitle like ‘%DBA%’If they have DBA in the job title

UNION ALL

SELECT

‘Other’ as JobTitle

,COUNT(*) NoOfReplies

,AVG (SalaryUSD) AvgSalary

,MAX (SalaryUSD) MaxSal

,MIN(SalaryUSD) MinSal

FROM [dbo].[SalarySurvey]

where JobTitle NOT like ‘%DBA%’If they have DBA in the job title

AND JobTitle NOT like ‘%Dev%’If they have DBA in the job title

Order by AvgSalary desc

Using the base data we can see that ‘other’ job titles have the highest average salary. With the DBA earning approximately $7000 a year more than than their developer colleagues. DBAs MAKE MORE THAN DEVELOPERS!

We can see from the max and min values, that there are outliers that could be impacting on the average salaries.

In order to compare these average salaries with the outliers removed, I will use a CTE and a SELECT INTO statement to create a new table with the outliers removed. I used this CTE combined with NTILE which I discussed in my previous post. Now I am using the CTE to create a persisted table in a database.

with ctess as

(select

NTILE (20) OVER (ORDER BY SalaryUSD Desc) as tile

,*

from SalarySurvey), ctetile as (

SELECT *

from ctess

WHERE tile > 1

and tile < 20 )

–NTILE will allocate each row a result)

SELECT * into ctetilero FROM ctetile

I’ll now run the UNION query above but replace the original table with the outliers removed table which I have called ctetilero.

SELECT

‘Developer’ as JobTitle

,COUNT(*) NoOfReplies

,AVG (SalaryUSD) AvgSalary

,MAX (SalaryUSD) MaxSal

,MIN (SalaryUSD) MinSal

FROM [dbo].ctetilero

where JobTitle like ‘%dev%’If they have dev in the job title

UNION ALL

SELECT

‘DBA’ as JobTitle

,COUNT(*) NoOfReplies

,AVG (SalaryUSD) AvgSalary

,MAX (SalaryUSD) MaxSal

,MIN(SalaryUSD) MinSal

FROM [dbo].ctetilero

where JobTitle like ‘%DBA%’If they have DBA in the job title

UNION ALL

SELECT

‘Other’ as JobTitle

,COUNT(*) NoOfReplies

,AVG (SalaryUSD) AvgSalary

,MAX (SalaryUSD) MaxSal

,MIN(SalaryUSD) MinSal

FROM [dbo].ctetilero

where JobTitle NOT like ‘%DBA%’If they have DBA in the job title

AND JobTitle NOT like ‘%Dev%’If they have DBA in the job title

Order by AvgSalary desc

The results

The results here with the outliers removed are intriguing. The average or mean of ‘Other’ salaries have dropped by approximately $12000, DBA average salary has gone up approximately $1500 and developer salaries have nudged up by approximately $160. So, it seems at least according to the data in this survey that DBAs do earn more than developers. In the introduction to SQL Server course, there is a slide that states that the DBA earns the big salary because they need to know the intricacies of SQL Server settings. Well according to this survey that slide is accurate. If you would like to learn about writing SELECT statements and queries and apply some of the techniques used here, you can take Learning Tree’s Developing SQL Queries for SQL Server course.

Type to search blog.learningtree.com

Do you mean "" ?

Sorry, no results were found for your query.

Please check your spelling and try your search again.