There's a DBA stackexchange site but I see a lot of SQL questions on StackoverFlow. When do these questions belong on one site vs the other?
The DBA FAQ has these items regarding SQL:
If you have a question about...
- Advanced Querying including window-functions dynamic-sql and query-performance
- Advanced Programming in built-in server-side languages including stored-procedures and triggers.
…then you're in the right place to ask your question!
but, dba.se is not the right place to ask questions about...
- Client-side programming - ask on Stack Overflow
- Basic SQL - ask on Stack Overflow
So that's the cut-off: the DBA site welcomes advanced querying problems and server-side programming. Simple SQL, and anything not programmed inside the database itself isn't considered on topic.
Now obviously "simple"/"advanced" are relative terms, and complexe queries are also treated well on Stack Overflow. So the line isn't clear-cut.
In my opinion, the closer you are to the database engine (digging inside explain plans, tuning indexing strategies for complex/expensive operations, trying to hint the optimizer to tweak a path, actually installing a database or doing replication, backups, ...), the more you should think about posting on DBA rather than on Stack Overflow.
See also What kind of questions are allowed on Database Administrators? on DBA's meta for a lengthy list of what sort of questions are welcome over there.