
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can we see the list of views stored in a particular MySQL database?
With the help of following queries, we can see the list of views stored in a particular database. We are using the database named ‘query’ here.
mysql> SELECT TABLE_NAME FROM information_schema.`TABLES` WHERE TABLE_TYPE LIKE'view' AND TABLE_SCHEMA LIKE 'query'; +-----------------------------+ | TABLE_NAME | +-----------------------------+ | customer_view | | first_view | | info | | info_less | | view_detail | | view_student_detail | | view_student_detail_columns | +-----------------------------+ 7 rows in set (0.01 sec) mysql> SHOW FULL TABLES IN query WHERE TABLE_TYPE LIKE 'VIEW'; +-----------------------------+------------+ | Tables_in_query | Table_type | +-----------------------------+------------+ | customer_view | VIEW | | first_view | VIEW | | info | VIEW | | info_less | VIEW | | view_detail | VIEW | | view_student_detail | VIEW | | view_student_detail_columns | VIEW | +-----------------------------+------------+ 7 rows in set (0.01 sec) mysql> SELECT TABLE_SCHEMA, TABLE_NAME -> FROM information_schema.tables -> WHERE TABLE_TYPE LIKE 'VIEW'AND TABLE_SCHEMA = 'query'; +--------------+-----------------------------+ | TABLE_SCHEMA | TABLE_NAME | +--------------+-----------------------------+ | query | customer_view | | query | first_view | | query | info | | query | info_less | | query | view_detail | | query | view_student_detail | | query | view_student_detail_columns | +--------------+-----------------------------+ 7 rows in set (0.05 sec)
- Related Articles
- How can we see only the list of stored procedures in a particular MySQL database?
- How can we see only the list of stored functions in a particular MySQL database?
- How can we see the list of stored procedures and stored functions in a particular MySQL database?
- How can we see the list, along with other information, stored procedures in a particular MySQL database?
- How can we see the list, along with complete information, of stored procedures in a particular MySQL database?
- How can we see the list, along with complete information, of stored functions in a particular MySQL database?
- How can we see the metadata of a view(s) stored in a particular MySQL database?
- How can we see the list, along with some other information, of stored functions in a particular MySQL database?
- How can we see only name and types of the stored routines in a particular MySQL database?
- How can we see the source code of a particular MySQL stored procedure?
- How can we see the source code of a particular MySQL stored function?
- How can we get the list of tables in a particular database from MySQL Server command line?
- How can we create MySQL views with column list?
- How can we delete a MySQL stored function from the database?
- How can we check the default character sets of a particular MySQL database?

Advertisements