completed sl_valuation.sql script, tested with postgres and all is working as intended