• neidu3@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    4
    ·
    27 days ago

    I haven’t postgres’d in ages, but I’ll give it a shot anyway:

    SELECT name FROM boys WHERE good = true;  
    
      • neidu3@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        27 days ago

        But now for the advanced and important stuff: How can we modify it to also pull the same from the table “girls” in a single query? I like SQL efficiency and inclusivity, and I’m sure half of all dogs agree. (Well, according to my research, all dogs like inclusivity, but only 50% likes SQL efficiency)

        • Lena@gregtech.eu
          link
          fedilink
          English
          arrow-up
          1
          ·
          21 days ago

          A better database design would have been to name the table dogs and add a column to indicate whether the dog is a boy or a girl, maybe with enums