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 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.
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.
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.
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 would go so far as to say I've never seen anyone use the visual query designer.
I myself have never used it.
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.
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.
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.
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.
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.