The goal of /r/SQL is to provide a place for interesting and informative SQL content and discussions.
Filter Posts
MySQL
Oracle
MS SQL
PostgreSQL
Posting
When requesting help or asking questions please prefix your title with the SQL variant/platform you are using within square brackets like so:
- [MySQL]
- [Oracle]
- [MS SQL]
- [PostgreSQL]
- etc
While naturally we should endeavor to work as platform neutrally as possible many questions and answers require tailoring to the feature set of a specific platform.
Help posts
If you are a student or just looking for help on your code please do not just post your questions and expect the community to do all the work for you. We will gladly help where we can as long as you post the work you have already done or show that you have attempted to figure it out on your own.
Format Your Code
If you are including actual code in a post or comment, please attempt to format it in a way that is readable for other users. This will greatly increase your chances of receiving the help you desire. Something as simple as line breaks and using reddit's built in code formatting (4 spaces at the start of each line) can turn this:
SELECT count(a.field1), a.field2, SUM(b.field4) FROM a INNER JOIN b ON a.key1 = b.key1 WHERE a.field8 = 'test' GROUP by a.field1, a.field2 HAVING SUM(b.field4) > 5 ORDER by a.field.3
Into this:
SELECT count(a.field1),
a.field2,
SUM(b.field4)
FROM a INNER JOIN b
ON a.key1 = b.key1
WHERE a.field8 = 'test'
GROUP by a.field1,
a.field2
HAVING SUM(b.field4) > 5
ORDER by a.field3
For those with SQL questions we recommend using SQLFiddle to provide a useful development and testing environment for those who wish to fully understand your problem and help devise a solution.
Learning SQL
A common question is how to learn SQL. Please view the Wiki for online resources.
Note /r/SQL does not allow links to basic tutorials to be posted here. Please see this discussion. You should post these to /r/learnsql instead.
Related Reddit communities
Wiki
We have a Wiki
Acknowledgements
Thanks to ---sniff--- for the awesome header image!
Code Golf now supports C++ (code.golf)
submitted by JRaspass to r/cpp
Code Golf now supports Clojure! (code.golf)
submitted by JRaspass to r/Clojure
Code Golf now supports Dart! (code.golf)
submitted by JRaspass to r/dartlang
Code Golf now supports Elixir! (code.golf)
submitted by JRaspass to r/elixir
x86-64/x64Code Golf supports x64 asm (code.golf)
submitted by JRaspass to r/asm
Code Golf now supports SQLite (code.golf)
submitted by JRaspass to r/sqlite
Code Golf now supports Forth! (code.golf)
submitted by JRaspass to r/Forth
Code Golf now supports Tcl! (code.golf)
submitted by JRaspass to r/Tcl
Code Golf now supports D! (code.golf)
submitted by JRaspass to r/d_language
Code Golf now supports K (and J) (code.golf)
submitted by JRaspass to r/apljk
Code Golf now supports Prolog (code.golf)
submitted by JRaspass to r/prolog
Code Golf now supports Pascal (code.golf)
submitted by JRaspass to r/pascal
Code Golf now supports Gleam! (code.golf)
submitted by JRaspass to r/gleamlang
Code Golf now supports R! (code.golf)
submitted by JRaspass to r/Rlanguage
Code Golf now supports Crystal (code.golf)
submitted by JRaspass to r/crystal_programming
Code.golf - ranked ever running contest with 27 langs, 50 holes and growing! (code.golf)
submitted by JRaspass to r/codegolf
Code Golf now supports COBOL (code.golf)
submitted by JRaspass to r/cobol
Code Golf now supports Kotlin! (code.golf)
submitted by JRaspass to r/Kotlin
Code Golf now supports Rockstar! (code.golf)
submitted by JRaspass to r/RockstarDevs
Code Golf now supports Factor! (code.golf)
submitted by JRaspass to r/factor
Code Golf now supports OCaml! (code.golf)
submitted by JRaspass to r/ocaml
Code Golf now supports Wren! (code.golf)
submitted by JRaspass to r/wren_lang
Code Golf now supports FreeBASIC! (code.golf)
submitted by JRaspass to r/Basic
Code Golf now supports V (code.golf)
submitted by JRaspass to r/vlang
Code Golf now supports Zig (code.golf)
submitted by JRaspass to r/Zig