I am trying to do some SQL to create a VIEW in SQLite (but could be also in PostgreSQL on the second version of the app). And this is just beyond my SQL knowledge and my google-fu to resolve this is failing.
table 1: person
UUID as string (Unique UID that is 32+ characters in length)
name as string (this is the person's name)
...
table 2: relationshipType
UUID as string (Unique UID that is 32+ characters in length)
name as string (this is the relationship name - Supervisors, Manager, etc)
...
table 3: supervisorRelationships
UUID as string (Unique UID that is 32+ characters in length)
boss_UUID as string (UUID from person table)
employee_UUID as string (UUID from person table)
relationship_UUID as string (UUID from relationshipType table)
...
now I want to create a VIEW that has the following information
UUID as string (UUID from table 3)
bossName as string (name field from table 1 where table 3.boss_UUID = table 1.UUID)
employeeName as string (name field from table 1 where table 3.employee_UUID = table 1.UUID)
relationshipName as string (name field from table 2 where table 3.relationship_UUID = table 2.UUID)
but whenever I try to create the SQL queries I am failing left and right. it is beyond my skills set.
can anyone give me a clue how to do this?
thanks
sb