[#33676] Improve DB Query Code quality

Uses Internal db constructor + uses quoteName for the table name