• jjjalljs@ttrpg.network
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    2 hours 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