• saltesc@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    edit-2
    3 hours ago

    SQL enjoyer?

    Every time I use it I feels like I’m going back to the 90s. No variables, no functions; Oh but you can do a CTE or subquery…👍

    UNION ALL, UNION ALL, UNION ALL… “There’s got to be a better way, surely…”

    looks up better way

    “Oh, what the fuck?!.. Nope, this will just be quicker…” UNION ALL, UNION ALL, UNION ALL…

    Join in a table sharing column names… Everything breaks. You gotta put the new prefixes in front of all the headers you called in now. In every select, in every where, etc… Which is weird because that kinda works like a variable and it’s fine…

    “When you see this little piece of text, it means all this, got it?”

    “Okay. Yep. Easy.”

    “So why can’t you do that with expressions?”

    SQL SCREAMS MANICALLY

    “Okay, okay, okay!.. Jesus…”

    And then you try put a MAX in a where and it won’t let you because you gotta pull all the maxes out in their own query, make a table, join them in, and use them like a filter…

    I hate it. It has speed, when you can finally run the script, but everything up to that is so…ugh.

    • jjjalljs@ttrpg.network
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      33 minutes ago

      Personally I feel like SQL syntax is upside down, and things are used before they are defined.

      SELECT 
      a.id -- what the fuck is a?
      , a.name
      , b.city -- and b??
      from users a -- oh 
      join city b on a.id = b.user_id -- oh here's b
      

      I’d expect it to instead be like

      From users a
      join city b on a.id = b.user_id
      SELECT
      a.id,
      a.name,
      b.city
      
    • expr@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      22 minutes ago

      No variables, no functions

      Every major SQL implementation includes both of those things. Of course, it’s rarely needed or desirable if you know how to properly write SQL.

      “So why can’t you do that with expressions?”

      You can alias expressions.

      And then you try put a MAX in a where and it won’t let you because you gotta pull all the maxes out in their own query, make a table, join them in, and use them like a filter…

      Wtf are you talking about? For one, filtering by the output of an aggregate is what the HAVING clause is for. But even if that didn’t exist, you could just use a subquery instead. You don’t need to make table…

      Tbh it just sounds like you don’t know SQL very well. Which is fine, but doesn’t make for a very compelling criticism. SQL does have warts (even though it’s great overall), but none of what you described are real problems.

    • DarkAngelofMusic@lemmy.sdf.org
      link
      fedilink
      arrow-up
      7
      ·
      3 hours ago

      While I agree that “SQL Enjoyer” seems like a weird category, I personally love SQL. I’ve been using it professionally for over 20 years, and I’ve yet to encounter a more elegant, efficient, and practical language for handling data in a relational database. Every attempt I’ve seen to replace it with something simpler has fallen far short.

      Which database systems were you dealing with, that didn’t allow variables? My personal favorite is PostgreSQL, which does allow them on scripting languages, such as PLPGSQL.

      • Jesus_666@lemmy.world
        link
        fedilink
        English
        arrow-up
        6
        ·
        2 hours ago

        See, I don’t have to worry about such details. I work in corporate software dev, which means that everything is an MSSQL database where most of the tables contain only an ID of a table-specific format and a JSON blob. Why use an ORM when you can badly reimplement NoSQL in a relational database instead?

        • The Quuuuuill@slrpnk.net
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 hours ago

          hey hey, there there. don’t worry. most of the major NoSQL DBs implement just as horrible of travesties

    • Valmond@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 hours ago

      LEFT JOIN

      Includes empty entries, doubles others.

      It sure is long due for an overhaul.

  • Rose@slrpnk.net
    link
    fedilink
    arrow-up
    3
    ·
    4 hours ago

    Yeah I wouldn’t date an RStudio user. Real men do their R coding in Jupyter.

    • sp3ctr4l@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 hours ago

      … and thus they also have no time left to date.

      I was gonna comment on why Jupyter isn’t on here, and then I realized that any one who uses ‘raw’ R and/or Jupyter… they have 0 free time, they are generally overworked as fuck, thus they correctly are not even on a dating social graph.

      Search your heart, or your datasets, you know it to be true.

    • adry@piefed.social
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 hours ago

      The only truth in your statement is that I don’t need any dates. RStudio is my loyal waifu.