Check out example codes for "show sql server database". It will help you in understanding the concepts better.

Code Example 1

SELECT * FROM SYS.DATABASES

Code Example 2

SELECT * FROM SYS.SYSDATABASES

Code Example 3

SELECT name FROM master.dbo.sysdatabases

Code Example 4

EXEC sp_databases

Code Example 5

SELECT name FROM master.SYS.DATABASES

Learn ReactJs, React Native from akashmittal.com