I have a database with several tables that is linked to the main table with ID fields, and is kind of "lookup tables". I'm trying to get a query that will eliminate a lot of programming, but I am just not getting anywhere.
This is a simplified version of the database schematic and the resulting query I want.
I have tried tons of variations with JOIN, UNION, WHERE, etc, but I just cannot get it right - though it seems like it should be very simple. I am learning SQL, but this one seems above my capability!
I'm attaching the above sqlite database for anyone willing to help.
Just a note, my actual database has more than 10 of these "lookup" fields and hundreds of records, so creating the result table will be possible through programming, but it will be very cumbersome! I'm hoping to get a more efficient solution with SQL.
Any help will be GREATLY appreciated!
This is a simplified version of the database schematic and the resulting query I want.
I have tried tons of variations with JOIN, UNION, WHERE, etc, but I just cannot get it right - though it seems like it should be very simple. I am learning SQL, but this one seems above my capability!
I'm attaching the above sqlite database for anyone willing to help.
Just a note, my actual database has more than 10 of these "lookup" fields and hundreds of records, so creating the result table will be possible through programming, but it will be very cumbersome! I'm hoping to get a more efficient solution with SQL.
Any help will be GREATLY appreciated!