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

Code Example 1

SELECT * FROM SYS.DATABASES

Code Example 2

SELECT name FROM master.SYS.DATABASES

Code Example 3

EXEC SP_DATABASES

Code Example 4

SELECT * FROM SYS.SYSDATABASES

Code Example 5

SELECT name FROM master.dbo.sysdatabases

Learn ReactJs, React Native from akashmittal.com