I have two tables in a database, like so (simplified for question purposes):

I don’t want to modify the existing tables or create a new one, but I would like to put all of this data into a consolidated object in my code like so:

There are actually more properties in TABLE2 but I am only interested in food and color.
I’m completely new to databases so bear with me – is there a simple way to do this? What I’m thinking so far is doing
SELECT * FROM TABLE1
SELECT PROPERTY_VALUE, UNIQUE_IDENTIFIER
FROM TABLE2
WHERE PROPERTY_NAME = 'Favorite Color'
SELECT PROPERTY_VALUE, UNIQUE IDENTIFIER
FROM TABLE2
WHERE PROPERTY_NAME = 'Favorite Food'
and then putting them together somehow… Is there a better way? Or if not, where do I go from here?
There are a couple ways to do this, but regardless of which one you use, you generally need to know the number and names of the columns in the result set at the time you write the query. I can give you Favorite Food and Favorite Color, but if there’s any other properties in that table you won’t see them. There is no way to automate that with vanilla sql; you must use dynamic sql or a client-side language if you want to get arbitrary properties from that kind of schema.
With that constraint out of the way, let’s look at one way you could do this:
Another option is to use the PIVOT keyword, but until we know more details of your actual data, the join above is sufficient.