There's a pretty good discussion that I've been part of on Andrew Powell's blog and Ben Nadel's blog about whether a web developer should have to write SQL code. Andrew says that developers should concentrate on web code and either leave the SQL in the expert hands of DBAs or should use an ORM that abstracts the SQL code for the developer. Ben thinks that developers should have some understanding of SQL for the sake of writing better applications.
I think that web developers should know SQL because SQL is a great, and sometimes necessary, skill to have throughout your career. Simply put, DBAs (and ORM software) arent' available for every project. While I will glady (eagerly! quickly!) hand over the responsibility for database creation, maintenance, and query input/output to a DBA if one is available, most of the time such a person isn't there. I've worked in medium-sized companies, tiny companies, and by myself, and for most every project I've been the only resource available to manage databases and SQL. I've had to learn it. And even if you, as a developer, currently work at a company that has a DBA, I feel confident in saying that you're not going to find as many opportunities with other companies if you don't know any SQL.
Andrew does make the good point that developers probably aren't going to know SQL as well as a DBA will, because the DBA makes a focus on the SQL language. I would agree. And I also agree with his suggestion that you should never be afraid to ask how to do something, or to do it better. But I disagree with the contention that developers shouldn't need to know SQL. I think that the web industry gets a lot more good out of developers' SQL than bad.

Comments (6)
March 27, 2008
2:57PM | #
Now don't go misquoting me... I said developers should not be writing SQL, not that they shouldn't know it. :)
March 27, 2008
3:08PM | #
@Andrew: You're right, I don't want to mischaracterize the nature of your post (I've changed that sentence above). However, I'll contend that it seems to be a matter of semantics as to whether a developer should "know" SQL versus "write" SQL, since they go hand-in-hand. I can't imagine that anyone would suggest developers should know SQL but not bother writing it.
March 27, 2008
3:51PM | #
I'm a client-side developer with pretty good SQL Skills. I suppose this makes me a qualified 'web developer' and for a very small company, I'd be the DBA.
I'm of the opinion that there isn't a required field of study in programming in order to call yourself a "Client-Side Developer" or "Web Developer" or even a "DBA".
If you want to show basic competencies:
-take a certification exam
-build a project that is capable of X
I saw in another discussion on Andrew's blog that someone remarked how a CF Developer should have to know HTML, but, as a CF developer for 8 years who uses CF almost exclusively for Flex & Flash, I'd argue the point is invalid.
March 27, 2008
4:02PM | #
Tom,
I would agree that any ColdFusion programmer who uses a database (which would be most) should know SQL.
However, as to: "I can't imagine that anyone would suggest developers should know SQL but not bother writing it.", I am not sure that I agree there.
I certainly feel like I know SQL pretty well at this point, but other than a few ad-hoc queries for brief data requests or something I don't know that I have written any SQL in the last month.
March 27, 2008
4:13PM | #
Steve, you're right that someone could know SQL yet get by without using it at all, given the use of a DBA or a tool like your DataMgr. But what I really meant was for the span of a career, I think that a developer should know SQL, even though they may not use it all the time. And even with DataMgr, you yourself have used SQL a few times in the last month! ;)
Hey, will I see you at cfObjective this May?
March 27, 2008
6:53PM | #
Tom,
Agreed. I think (Andrew correct me if I am wrong) that Andrew was mostly arguing that our programming can *usually* be more efficient if he avoids writing SQL - either by the use of a database abstraction layer, ORM, or DBA.
I think that is a valid point.
Even so, I agree with you that SQL is a necessary (not just valuable) skill for any ColdFusion programmer and one with which none should get too far out of practice.
Tools like ORMs or DataMgr aren't meant to handle every situation in which you might need to access a database and SQL is very often the best tool for the job.
Yes, I will be at CFObjective. Looking forward to seeing you there!