Johnnei's World
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
andioop@programming.dev to Programmer Humor@programming.devEnglish · 2 months ago

Little Timmy Tables

programming.dev

message-square
57
link
fedilink
1.36K

Little Timmy Tables

programming.dev

andioop@programming.dev to Programmer Humor@programming.devEnglish · 2 months ago
message-square
57
link
fedilink
  • NullPointerException@lemmy.ca
    link
    fedilink
    arrow-up
    112
    ·
    2 months ago

    Why would Santa need two separate tables for this?

    • spiffpitt@lemmy.world
      link
      fedilink
      English
      arrow-up
      148
      ·
      2 months ago

      don’t underestimate database design in production environments

      • phorq@lemmy.ml
        link
        fedilink
        arrow-up
        42
        ·
        2 months ago

        Exactly, Santa’s always watching and audit logs get complicated

    • unalivejoy@lemmy.zip
      link
      fedilink
      arrow-up
      104
      arrow-down
      1
      ·
      2 months ago

      I would make two separate views.

      CREATE VIEW NiceList AS
       SELECT * FROM Children
        WHERE behavior = 'nice' 
         AND parent.income > 40000; 
      CREATE VIEW NaughtyList AS
       SELECT * FROM Children
        WHERE behavior = 'naughty'; 
      
      • NullPointerException@lemmy.ca
        link
        fedilink
        arrow-up
        67
        ·
        2 months ago

        The income is a nice touch.

      • criss_cross@lemmy.world
        link
        fedilink
        arrow-up
        29
        ·
        2 months ago

        The poor kids can’t even afford coal and fall through the cracks.

        • Laurel Raven@lemmy.zip
          link
          fedilink
          English
          arrow-up
          11
          ·
          2 months ago

          Only the nice ones, the naughty poor children get free coal

          • naeap@sopuli.xyz
            link
            fedilink
            arrow-up
            4
            ·
            2 months ago

            But not the poor nice ones

            • Rusty Shackleford@programming.dev
              link
              fedilink
              English
              arrow-up
              5
              ·
              2 months ago

              The poor nice ones get beaten by the naughty rich ones.

              • ulterno@programming.dev
                link
                fedilink
                English
                arrow-up
                0
                arrow-down
                1
                ·
                2 months ago

                … and by the “nice” rich ones.

      • ryannathans@aussie.zone
        link
        fedilink
        arrow-up
        7
        ·
        2 months ago

        You forgot the join smh

        • unalivejoy@lemmy.zip
          link
          fedilink
          arrow-up
          5
          ·
          2 months ago

          Omitted for brevity.

      • KairuByte@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        7
        ·
        2 months ago

        Why are we using magic strings for behavior?

        • unalivejoy@lemmy.zip
          link
          fedilink
          arrow-up
          27
          ·
          2 months ago

          Feel free to fork my comment.

          • Tja@programming.dev
            link
            fedilink
            arrow-up
            12
            ·
            2 months ago

            Does Santa accept PRs?

          • uranibaba@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            1 month ago
            CREATE VIEW NiceList AS
             SELECT * FROM Children
              WHERE behavior > 2000
               AND parent.income > 40000; 
            CREATE VIEW NaughtyList AS
             SELECT * FROM Children
              WHERE behavior <= 2000; 
            
        • The Octonaut@mander.xyz
          link
          fedilink
          arrow-up
          16
          ·
          2 months ago

          It’s an ENUM and other people have to read this fucking codebase too, Brian!

          • Olap@lemmy.world
            link
            fedilink
            arrow-up
            6
            ·
            2 months ago

            I’ve a DBA who would insist on this being in a dimension table and using a foreign key constraint instead of just a fucking string

        • djmikeale@feddit.dk
          link
          fedilink
          arrow-up
          8
          ·
          2 months ago

          He used to have an is_nice bool but consultants convinced Santa it isn’t future proof enough to capture the nuances of kids behaviour in today’s world, such as “nice but always is really smug about it”. But the consultants kept making PowerPoints instead of updating the backend, so now Santa also has added a new value to behaviour: “consultant-like”

      • Willy@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        2
        ·
        2 months ago

        stop static “variables”! use COL. congress should do the same for setting minimum wage. eg parent.income > COL

      • menas@lemmy.wtf
        link
        fedilink
        arrow-up
        3
        ·
        2 months ago

        which default currency shall santa use ? Dollar have no sense, if presents are free. However Yuan may ease things with providers.

        • unalivejoy@lemmy.zip
          link
          fedilink
          arrow-up
          8
          ·
          2 months ago

          He’s in the north pole, so probably Canadian dollars, Russian rubles, or Danish krone (Greenland)

    • ilinamorato@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      edit-2
      2 months ago

      Relational database. He’s got children, which joins to naughty and nice on childid and both record their status each year so that he can monitor trends.

    • chocrates@piefed.world
      link
      fedilink
      English
      arrow-up
      6
      ·
      2 months ago

      Once you get a few thousand columns wide you create a naughty_list2 for the new data

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.47K users / day
  • 3.99K users / week
  • 7.72K users / month
  • 17.3K users / 6 months
  • 1 local subscriber
  • 29.4K subscribers
  • 1.99K Posts
  • 68.5K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • UI: 0.19.13
  • BE: 0.19.15
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org