Jesus died at 33, so that can’t get returned in the query response lol

  • muel@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    11 months ago

    Slightly off-topic: I get so confused with age conventions. I’m self-taught and do some ad-hoc work for the organization I work for (where no one else has any interest).

    To get users between 25 and 30, wouldn’t you want strictly less than 30? And greater than or equal to 25? Or for age is it inclusive?

    • Whelks_chance@lemmy.world
      link
      fedilink
      arrow-up
      16
      ·
      11 months ago

      Realistically you wouldn’t store age, you’d store birthdate or possibly a datetime value, and calculate it from there

      • hansl@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        11 months ago

        First Normal Form users unite!

        By the by, as someone who have used both NoSQL and SQL extensively (once in the same project), the trick of NoSQL is that you shouldn’t use FNF and compute that at write time. The idea is that it’s faster to MapReduce pre calculated values since that’s the operation you want to optimize in a NoSQL world. A lot of people get that wrong and just replace MySQL with Mongo without rethinking usage and schemas.

        But even in a NoSQL context I’d rather use a Postgres jsonb column over MongoDB.

    • V0lD@lemmy.world
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      edit-2
      11 months ago

      Why strictly less than 30 and greater or equal 25? (25 ≤ X < 30)

      Shouldnt it be strictly less and strictly more (25 < X < 30)?

      • Skua@kbin.social
        link
        fedilink
        arrow-up
        7
        ·
        11 months ago

        I guess you could argue that people we refer to as “25 years old” are actually 25 years and some days/hours/minutes/whatever old, therefore more than 25. People referred to as 30 are, in the same vein, more than 30

        • V0lD@lemmy.world
          link
          fedilink
          arrow-up
          3
          arrow-down
          2
          ·
          11 months ago

          Even if you’re 25 and 11 months, you should still be counted as 25. Same way it should be for other age based restrictions

            • MeanEYE@lemmy.world
              link
              fedilink
              arrow-up
              3
              ·
              11 months ago

              Unrelated question but why can’t one have a cake and eat it? Presumably that’s why you’d own a cake in the first place. Or is world filled with people eating other people’s cakes but no owner is ever allowed to. Such a mysterious saying…

              • DABDA@lemmy.world
                link
                fedilink
                English
                arrow-up
                2
                ·
                11 months ago

                The easiest way to parse the meaning is to reverse the statement order, i.e. “Can’t eat your cake and have it too.” If you ate it, you wouldn’t have it. If you have it, you haven’t eaten it. The two states are mutually exclusive.

                  • DABDA@lemmy.world
                    link
                    fedilink
                    English
                    arrow-up
                    3
                    ·
                    11 months ago

                    Totally agree. I’ve never been a fan of the saying and it only clicked properly for me when I heard it explained with the statement reversal.

              • Tlaloc_Temporal@lemmy.ca
                link
                fedilink
                arrow-up
                1
                ·
                11 months ago

                That phrase is about fancy cakes, like wedding cake art. You can’t keep the art and eat the cake. Like the food network cake competitions, some of those things are super creative, but you can’t have the art and eat the cake.

                It’s like painting custom wrapping paper, or printing on toilet paper. If the purpose of something is to be consumed or destroyed, it can’t do that and look good at the same time. You have to choose between having pretty mocha art and drinking a mocha.

            • V0lD@lemmy.world
              link
              fedilink
              arrow-up
              1
              arrow-down
              1
              ·
              11 months ago

              I’m not contradicting anything. I think someone who’s 25 years and 11 months should not be returned from the query. Hence, the strict inequality

                • V0lD@lemmy.world
                  link
                  fedilink
                  arrow-up
                  1
                  arrow-down
                  1
                  ·
                  edit-2
                  11 months ago

                  Okay, since you’re starting to throw insults via this angle, let’s try to make my case via a different route

                  Do you think the db is storing your age as an int or as a float? We know from the given information that it is stored as a singular number

                  So, I’m assuming it’s as an int, which means that until you’re 26, you’re still 25. If you’re 25 and 11 months, that’s still 25 years old, and stored as such. The strict inequality should therefore not put it in the range 25 < X < 30

    • QuinceDaPence@kbin.social
      link
      fedilink
      arrow-up
      2
      arrow-down
      2
      ·
      11 months ago

      “Between 25 and 30” would tell me 25 birthday (since even at 12:00:01 you are over 25 by a second) to one second before 30th birthday.

      So ages 25, 26, 27, 28, and 29.