Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I was just curious if SQL Devs write their code freehand or do they make use of the visual query designer to generate queries? In the majority of the cases, the query designer can create most of non-complex queries, no? (I'm a WinForms dev just now getting started with SQL Server)

share|improve this question
3  
I use a visual query designer, it's called emacs. Occasionally I'll do it "freehand" in vi. –  dietbuddha Feb 1 '11 at 8:03
add comment

13 Answers

I can't speak for anybody else, but I usually just type SQL in "freehand", as you put it. Most of the visual query designers seem (to me) to increase complexity rather than reducing it. I should add that I don't write SQL anywhere close to full-time either.

share|improve this answer
1  
I agree, even though I'm usually just remixing SQL queries I find on the Net. Visual Query Designers sort of assume you know the query language. –  Yar Feb 1 '11 at 7:08
3  
+1 for "...seem (to me) to increase complexity rather than reducing it" –  Ozz Feb 1 '11 at 15:33
    
same here (though I use mostly Oracle, not MS SQL). Generated SQL tends to be slow, overly complex. –  jwenting Apr 11 '11 at 7:28
add comment

I'm sure it depends, but I never use visual designers. Once you have a good feel of SQL and think in SQL, writing it becomes second nature. I would have a much more frustrating time using any visual designer than just writing raw SQL.

share|improve this answer
add comment

I would say the vast majority of reasonably experienced devs write it by hand. I am sure some newby or recent grads might use the visual designers but once you have some of the basics of SQL learnt writing by hand is much quicker.

share|improve this answer
add comment

I find that query designers are generally slow and cumbersome and cannot always handle complex queries. Many times I've had to copy/paste a query to some tool (usually Access/Excel) which then spends a few minutes thrashing over a query before declaring that it just can't handle it and it sends me to the text-edit mode.

share|improve this answer
add comment

Whenever I want to learn a new tool/language. I force myself to type it by hand. HTML, XAML, SQL. That way I know how to fix what the designer spews out. Once I'm good with hand writing, I then force myself to learn the designer as well as possible.

Being good with both, let's you have the best of both worlds...there are somethings that will be more efficient to do with a designer and others that are more efficient in code. Teaching yourself both lets you avoid the shortcomings of either.

share|improve this answer
add comment

I don't use query generates to generate my queries, I build them by hand initially (mostly because anything but the mot trivial of queries is hard to write in a query designer.

But on big systems this is not enough. Most heavy weight DB systems provide a query analysis tool that will take a query and show you the Query Execution Plan. You can then use this (with other tools) to try and optimize the Query.

Not only help with the query itself but also give you an indication of what tables need to be indexed and how they should be indexed but also potentially techniques for partitioning the data.

share|improve this answer
add comment

I would go so far as to say I've never seen anyone use the visual query designer.

I myself have never used it.

share|improve this answer
add comment

When I don't know the schema very well, I tend to use a query designer. This helps me learn the schema. Later... typing is much faster than drawing.

share|improve this answer
add comment

I would never consider using the designer to write my queries. I know my database schemas in great detail (and our databases have hundreds of tables) and don't have to think about how to join to them, I just type and the queries come rolling out.

share|improve this answer
add comment

I write all of my queries by hand. The visual designers mostly would only slow you down while scanning hundreds of tables to present them nicely to you. A simple name completion for columns and table names plus a reference manual for your particular DB is everything you need to work with.

Note that my experience with the visual query designers is limited to tools working with the Oracle database.

share|improve this answer
add comment

I've written lots of SQL and PL/SQL code without ever using a query designer. For someone who knows SQL, using those tools is only cumbersome. That would be like drawing flowcharts in visio and letting a tool generate the program instead of actually writing a program.

share|improve this answer
add comment

Beginners start with the designer and too often their first glimps of SQL code was generated there. It looks too confusing because it is not formated in a structured/understandable way. Eventually you'll need to switch to coding in text and you have to straighten everything out. The formating is off. Intellisense has made it's way to sql writers. I'm starting to dabble with one of those since I'm working with a new database.

share|improve this answer
    
I find Intellisense slows me down, so I turned it off. –  HLGEM Apr 11 '11 at 19:41
add comment

I have written thousands of lines of Oracle SQL and PL/SQL over the past year. Most of the time I just run SqlPlus in an Emacs shell window. I have customized word-completion that makes it very efficient. A query designer would just slow me down. If I have to look at a large result set, then I will open SqlDeveloper, but I try not to because it's slow, and even though it can complete names based on the schema, it's still faster to work in Emacs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.