Supriya Roy Supriya Roy - 4 months ago 12
MySQL Question

master..sysdatabases is a sql server syntax. i would like to know if mysql has something like this

i am converting a sql server store procedure in MYSQL. and in this store procedure a line :

declare c1 cursor static for
select name from master..sysdatabases
where left(name,3) in ('ADM','ENT','DEM')
order by name asc


i would like to know what is the functionality of 'master..sysdatabases '?
what is the similar syntax for master..sysdatabases in MYSQL

Answer

what is the functionality of 'master..sysdatabases '?

SQL server divides databases into

1.User databases
2.System databases..

User database are the ones which users created,system databases(master,model,tempdb,msdb )are the one which comes with SQL installation..

In this case,user is trying to query all available database names matching them with string functions..

In MYSQL,you can use this..

select * from information_schema.SCHEMATA

http://dev.mysql.com/doc/refman/5.7/en/schemata-table.html