| What is INFORMATION_SCHEMA Database and why use this?
Before going to anything we will first discuss the definition of INFORMATION_SCHEMA Database.
First Definition
(1)"This is the database about databases"
Second Definition
(2)In RDBMS information_schema is an ANSI_standard set of read only views that will provide information about tables, views, columns and procedures in database.
we can use information_schema to get information about all the tables of particular database. Below is the example to get complete information about database.
use database_name
select * from INFORMATION_SCHEMA.TABLES;
Select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS;
As we have use the use keyword with database name the query only will be fire on the given database. Above query we will get all the information about the different tables and in second table we will get all constraint with table name.
| | |