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)
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.
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.
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
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.
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.
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.
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.