I would side with your enemy on this one.
The 'create a database and table logic' is clearly technically a separate responsibility from the 'get data from database' logic.
You can imagine the creation code getting pretty complex if we consider database migrations etc. Enough lines of code to justify a separate file.
You might want to restrict calling code to either creating or retrieving
In general, the time cost of making something more generic like this is hard to judge. One person might find it onerous and long winded another might do it as standard and think it quicker.
In my view YAGNI is never a good argument. If it's correct and done or quick to do, then its academic whether someone thinks they might not need it.