(My)SQL queries for empirically determining annual linear weights