Database logic for getting quotations and table alterations for quotation synopsis and labels