Yes, totally! it does not matter if you wrote the database, that helps you only to avoid writing the database name before a table. 
i actually tested in my enviroment before posting it! 
I used my production database and the mysql database to make some test and it worked. 
it will work also for mariadb, mysql and sql server.