After T243051: A query builder for MediaWiki core being done, we should use it which would improve readability of the code, avoids mistakes by passing the wrong order of arguments, etc. and would pave the way for further improvements such as T210206.
Note: It's not just select(). selectField(), selectFieldValues(), selectRow(), estimateRowCount(), and selectRowCount() also need to phased out.