Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. SqlFiddle : Test your sql online

SqlFiddle : Test your sql online

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasejavascriptmysqlpostgresqlsql-server
10 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raddevus
    wrote on last edited by
    #1

    Part 1 You probably know about jsfiddle and how you run and test your JavaScript in your browser. But there is also a SQLFiddle which allows you to run and test your sql in your browser[^]. It's quite convenient. Supports MySQl, Postgres, Sqlite, Oracle and Sql Server. Also, if you work on a query, you can save the URL and get back to it. Part 2 I recently discovered that you can do a select from two tables allowing you to select just the columns you want (versus a join). I don't know why that amazed me, but I'd never tried it before and it really helped in a current situation. here's a very simplified sqlfiddle example: SQL Fiddle[^] edit fixed initial link to sqlfiddle

    R Richard DeemingR Kornfeld Eliyahu PeterK S S 5 Replies Last reply
    0
    • R raddevus

      Part 1 You probably know about jsfiddle and how you run and test your JavaScript in your browser. But there is also a SQLFiddle which allows you to run and test your sql in your browser[^]. It's quite convenient. Supports MySQl, Postgres, Sqlite, Oracle and Sql Server. Also, if you work on a query, you can save the URL and get back to it. Part 2 I recently discovered that you can do a select from two tables allowing you to select just the columns you want (versus a join). I don't know why that amazed me, but I'd never tried it before and it really helped in a current situation. here's a very simplified sqlfiddle example: SQL Fiddle[^] edit fixed initial link to sqlfiddle

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Nice, but did you really intend to have a non-unique key in Address? :confused: /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      R 1 Reply Last reply
      0
      • R Ravi Bhavnani

        Nice, but did you really intend to have a non-unique key in Address? :confused: /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        R Offline
        R Offline
        raddevus
        wrote on last edited by
        #3

        Ravi Bhavnani wrote:

        but did you really intend to have a non-unique key in Address?

        :-O Oops! Updated the link (to the one where I fixed the key value in address). Thanks

        1 Reply Last reply
        0
        • R raddevus

          Part 1 You probably know about jsfiddle and how you run and test your JavaScript in your browser. But there is also a SQLFiddle which allows you to run and test your sql in your browser[^]. It's quite convenient. Supports MySQl, Postgres, Sqlite, Oracle and Sql Server. Also, if you work on a query, you can save the URL and get back to it. Part 2 I recently discovered that you can do a select from two tables allowing you to select just the columns you want (versus a join). I don't know why that amazed me, but I'd never tried it before and it really helped in a current situation. here's a very simplified sqlfiddle example: SQL Fiddle[^] edit fixed initial link to sqlfiddle

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          There are quite a few "fiddle" sites for different technologies: There's a fiddle for that![^] However, steer clear of refiddle DOT com for the moment. The site seems to have been taken over by an Indonesian casino. :doh:


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          1 Reply Last reply
          0
          • R raddevus

            Part 1 You probably know about jsfiddle and how you run and test your JavaScript in your browser. But there is also a SQLFiddle which allows you to run and test your sql in your browser[^]. It's quite convenient. Supports MySQl, Postgres, Sqlite, Oracle and Sql Server. Also, if you work on a query, you can save the URL and get back to it. Part 2 I recently discovered that you can do a select from two tables allowing you to select just the columns you want (versus a join). I don't know why that amazed me, but I'd never tried it before and it really helped in a current situation. here's a very simplified sqlfiddle example: SQL Fiddle[^] edit fixed initial link to sqlfiddle

            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu Peter
            wrote on last edited by
            #5

            If you didn't came across implicit join until now, then you better left it alone... It will translate to a cross join but without the clear syntax of it... It is not standard too (IIRC it started with MS Access)...

            "The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012

            "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

            P 1 Reply Last reply
            0
            • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

              If you didn't came across implicit join until now, then you better left it alone... It will translate to a cross join but without the clear syntax of it... It is not standard too (IIRC it started with MS Access)...

              "The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012

              P Offline
              P Offline
              Peter Adam
              wrote on last edited by
              #6

              Quite standard Postgresql. >Which one of these you use is mainly a matter of style. The JOIN syntax in the FROM clause is probably not as portable to other SQL database management systems, even though it is in the SQL standard. For outer joins there is no choice: they must be done in the FROM clause. The ON or USING clause of an outer join is not equivalent to a WHERE condition, because it results in the addition of rows (for unmatched input rows) as well as the removal of rows in the final result.

              1 Reply Last reply
              0
              • R raddevus

                Part 1 You probably know about jsfiddle and how you run and test your JavaScript in your browser. But there is also a SQLFiddle which allows you to run and test your sql in your browser[^]. It's quite convenient. Supports MySQl, Postgres, Sqlite, Oracle and Sql Server. Also, if you work on a query, you can save the URL and get back to it. Part 2 I recently discovered that you can do a select from two tables allowing you to select just the columns you want (versus a join). I don't know why that amazed me, but I'd never tried it before and it really helped in a current situation. here's a very simplified sqlfiddle example: SQL Fiddle[^] edit fixed initial link to sqlfiddle

                S Offline
                S Offline
                StarNamer work
                wrote on last edited by
                #7

                MS SQL recognises that syntax as a JOIN and generates exactly the same execution plan.

                R 1 Reply Last reply
                0
                • S StarNamer work

                  MS SQL recognises that syntax as a JOIN and generates exactly the same execution plan.

                  R Offline
                  R Offline
                  raddevus
                  wrote on last edited by
                  #8

                  Yeah, I think the main thing it helped me with was cleaning up my original Stored Proc query (which already had a bunch of joins). This helped me to easily add the one field I wanted without having to do all the join syntax and it ended up being a little cleaner.

                  1 Reply Last reply
                  0
                  • R raddevus

                    Part 1 You probably know about jsfiddle and how you run and test your JavaScript in your browser. But there is also a SQLFiddle which allows you to run and test your sql in your browser[^]. It's quite convenient. Supports MySQl, Postgres, Sqlite, Oracle and Sql Server. Also, if you work on a query, you can save the URL and get back to it. Part 2 I recently discovered that you can do a select from two tables allowing you to select just the columns you want (versus a join). I don't know why that amazed me, but I'd never tried it before and it really helped in a current situation. here's a very simplified sqlfiddle example: SQL Fiddle[^] edit fixed initial link to sqlfiddle

                    S Offline
                    S Offline
                    SeanChupas
                    wrote on last edited by
                    #9

                    There is also C# Online Compiler | .NET Fiddle[^]

                    raddevus wrote:

                    do a select from two tables allowing you to select just the columns you want

                    Do not ever do this. It is a very, very old way of doing joins, before join syntax was a thing. It is an ancient form of writing sql. And it IS a join, just in the WHERE clause.

                    R 1 Reply Last reply
                    0
                    • S SeanChupas

                      There is also C# Online Compiler | .NET Fiddle[^]

                      raddevus wrote:

                      do a select from two tables allowing you to select just the columns you want

                      Do not ever do this. It is a very, very old way of doing joins, before join syntax was a thing. It is an ancient form of writing sql. And it IS a join, just in the WHERE clause.

                      R Offline
                      R Offline
                      raddevus
                      wrote on last edited by
                      #10

                      Good to know. Thanks. I've been reading about it and will do more research.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups