Slashdot Mirror


How Would You Improve SQL?

theodp asks: "It was the best of languages, it was the worst of languages. SQL's handy, but it can also drive you nuts. For example, if you want all 100 columns from a table, 'SELECT *' works quite nicely. However, if you want all but 1 of the 100 columns, be prepared to spell out 99 column names. Wouldn't it not make sense to provide a Google-like shorthand notation like 'SELECT * -ColumnName' (or DROP=syntax like SAS)? So how would you improve SQL?"

9 of 271 comments (clear)

  1. No poetry by Fred_A · · Score: 3, Funny

    You can't write poetry in SQL. So it remains an inferior language compared to Perl.

    (yes, well, I ran out of ideas)

    --

    May contain traces of nut.
    Made from the freshest electrons.
    1. Re:No poetry by plover · · Score: 5, Funny
      SELECT * FROM roses, violets WHERE roses.color = 'red' AND violets.color = 'blue'

      --- -- ----
      All my base
      are belong to you.

      2 row(s) returned.

      --
      John
    2. Re:No poetry by mccoma · · Score: 4, Funny
      roses are red
      violets are blue
      you just did a Cartesian Product
      your DBA will be talking to you

      thank you, thank you, shows at 7 and 10, remember to tip the waitstaff

    3. Re:No poetry by Spock+the+Vulcan · · Score: 2, Funny

      It is theoretically impossible to get the results you listed with that SQL query.

    4. Re:No poetry by plover · · Score: 2, Funny
      It is theoretically impossible to get the results you listed with that SQL query.

      And it's also theoretically impossible to get this far in life without a sense of humor.

      I guess we were both wrong.

      --
      John
  2. Re:ugh... by lscoughlin · · Score: 2, Funny

    That's cute.

    Now start inserting and updating.

    maybe joining.

    yeah -- sql is stupid, sure. But you're proposal here really isn't any brighter.

    --
    Old truckers never die, they just get a new peterbilt
  3. mind reader by chochos · · Score: 3, Funny

    SELECT * FROM whatever the hell my customers have in mind

  4. Is this a test? by planetjay · · Score: 1, Funny

    USE Database;
    SELECT * FROM table WHERE column !="99";

    Did I get the job? Or for that matter DID YOU?

  5. Re:Native Queries / DLING by Tablizer · · Score: 2, Funny

    SQL is not object-oriented, it's use is usually neither typesafe nor compile-time checked

    This sounds like the fuel for a massive OO-vs-Relational and/or Dynamic-vs-Static typing holy war geek battle. Been in them and seen them rage for 1000+ messages. Batten down the hatches and hide the women and children.