- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can we see the metadata of a view(s) stored in a particular MySQL database?
The INFORMATION_SCHEMA database has a VIEWS table that contains view metadata i.e. data about views. To illustrate it we are taking the example of a view named ‘Info’.
Example
The following query will show the metadata of a view named ‘Info’ −
mysql> SELECT * from INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = 'Info' AND TABLE_SCHEMA = 'query'\G *************************** 1. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: query TABLE_NAME: info VIEW_DEFINITION:select`query`.`student_info`.`id`AS`ID`,`query`.`student_info`.`Name` AS `NAME`,`query`.`student_info`.`Subject` AS `SUBJECT`,`query`.` student_info`.`Address` AS `ADDRESS` from `query`.`student_info` CHECK_OPTION: NONE IS_UPDATABLE: YES DEFINER: root@localhost SECURITY_TYPE: DEFINER CHARACTER_SET_CLIENT: cp850 COLLATION_CONNECTION: cp850_general_ci 1 row in set (0.00 sec)
Advertisements