Check if db is installed

How to check if db is not installed to redirect user to /install/ folder? Should I count the tables list?

If you’re using MySQL you could use a SHOW DATABASES query to see what databases are installed