14

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)

1
  • 4
    I use a visual query designer, it's called emacs. Occasionally I'll do it "freehand" in vi.
    – snakehiss
    Feb 1, 2011 at 8:03

13 Answers 13

29

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.

3
  • 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. Feb 1, 2011 at 7:08
  • 4
    +1 for "...seem (to me) to increase complexity rather than reducing it"
    – ozz
    Feb 1, 2011 at 15:33
  • same here (though I use mostly Oracle, not MS SQL). Generated SQL tends to be slow, overly complex.
    – jwenting
    Apr 11, 2011 at 7:28
10

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.

5

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.

5

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.

3

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.

3

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.

3

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

I myself have never used it.

2

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.

1

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.

0

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.

0

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.

0

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.

1
  • I find Intellisense slows me down, so I turned it off.
    – HLGEM
    Apr 11, 2011 at 19:41
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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