当前位置:网站首页>What is the MySQL query view command
What is the MySQL query view command
2022-06-29 17:24:00 【Yisu cloud】
mysql Which is the query view command
This article mainly introduces “mysql Which is the query view command ”, In daily operation , I believe a lot of people are mysql There is some doubt about the query view command , Xiao Bian consulted all kinds of materials , Sort out simple and easy-to-use operation methods , I hope to answer ”mysql Which is the query view command ” Your doubts help ! Next , Please follow Xiaobian to learn !
mysql Query view command yes “DESCRIBE” perhaps “SHOW CREATE VIEW”.DESCRIBE The command can view the field information of the view , The grammar is “DESCRIBE View name ;”, It can be abbreviated as “DESC View name ;”; and “SHOW CREATE VIEW” Command to view the details of the view , The grammar is “SHOW CREATE VIEW View name ;”.
The operating environment of this tutorial :windows7 System 、mysql8 edition 、Dell G3 The computer .
After creating the view , You can view the field information and details of the view by viewing the statement of the view .
View the field information of the view
stay mysql in , Viewing the field information of the view is the same as viewing the field information of the data table , Is to use DESCRIBE Keyword to view .
describe Keyword is used to view the detailed design information of a specific view or table, etc , grammar :
DESCRIBE View name ;
Or abbreviated :
DESC View name ;
Example 1
Now create a student information table studentinfo A view of , Used to query student names and test scores .
Create a student information table studentinfo Of SQL Statement and run results are as follows :
CREATE TABLE studentinfo( ID INT(11) PRIMARY KEY, NAME VARCHAR(20), SCORE DECIMAL(4,2), SUBJECT VARCHAR(20), TEACHER VARCHAR(20));

Create a view to query student names and scores as follows :
CREATE VIEW v_studentinfo AS SELECT name,score FROM studentinfo;

adopt DESCRIBE Statement view view v_studentsinfo Field information in
DESCRIBE v_studentinfo;

Be careful : Use DESC Implementation results and use of DESCRIBE It's the same .
It can be seen from the running results that , The format of view field content is the same as that of table field content . therefore , It can better explain that the view is actually a data table , The difference is , The data in the view comes from the existing tables in the database .
See the details of the view
stay MySQL in ,SHOW CREATE VIEW Statement to view the detailed definition of the view . The syntax is as follows :
SHOW CREATE VIEW View name ;
Through the above sentence , You can also view the statement that created the view . The statement that creates the view can be used as a reference for modifying or recreating the view , Convenient for users to operate .
Example 2
Use SHOW CREATE VIEW View view ,SQL The statement and run result are as follows :
SHOW CREATE VIEW v_studentinfo \G

Above SQL Statement to \G ending , This enables the display results to be formatted . If not used \G, The results displayed will be confusing , As shown below :
SHOW CREATE VIEW v_studentinfo;

Here we are , About “mysql Which is the query view command ” That's the end of my study , I hope we can solve your doubts . The combination of theory and practice can better help you learn , Let's try ! If you want to continue to learn more related knowledge , Please continue to pay attention to Yisu cloud website , Xiaobian will continue to strive to bring you more practical articles !
边栏推荐
- Redis布隆过滤器和布谷鸟过滤器
- Why is informatization ≠ digitalization? Finally someone made it clear
- How to use interrupt
- 关于Go中两个模块互相调用的场景解决方案
- External automatic (PLC start robot)
- 2022年软件评测师考试大纲
- Open source warehouse contribution - submit pr
- @Component与@Configuration区别
- OpenFeign使用步骤 轮询策略与权重 log4j使用 openFeign拦截器的配置
- mysql数据库扫盲,你真的知道什么是数据库嘛
猜你喜欢

NVIDIA安装最新显卡驱动

微信小程序开发储备知识

mysql数据库扫盲,你真的知道什么是数据库嘛

What are the project management systems suitable for small and medium-sized enterprises?

linux中mysql 1045错误如何解决

@Difference between component and @configuration

PCB frame drawing - ad19

如何创建虚拟形象

Redis 原理 - Sorted Set (ZSet)

OpenFeign使用步骤 轮询策略与权重 log4j使用 openFeign拦截器的配置
随机推荐
2022 software evaluator examination outline
Issue 42: is it necessary for MySQL to have multiple column partitions
The R language uses the KAP function (kap.2.raters function) of epidisplay package to calculate the value of kappa statistics (total consistency, expected consistency), analyze the consistency of the
Mysql中锁的使用场景是什么
Go语言多方式并发实现龟兔赛跑
LeetCode 每日一题——535. TinyURL 的加密与解密
About Kali using xshell connection
L'intercepteur handlerinterceptor personnalisé permet l'authentification de l'utilisateur
ICML 2022 | 基于解耦梯度优化的可迁移模仿学习方法
Development of freedom free agreement pledge mining system
A user level thread library based on C language
controller、service、dao之间的关系
When MySQL RDS is collected using Flink CDC, the datetime type field will be compared with the source table after collection
About harbor private warehouse forgetting the login password
Open source warehouse contribution - submit pr
Viewing splitchunks code segmentation from MPX resource construction optimization
关于Go中两个模块互相调用的场景解决方案
Redis bloom filter and cuckoo filter
R语言ggplot2可视化:使用patchwork包(直接使用加号+)将两个ggplot2可视化结果横向组合、接着再和第三个图像横向组合起来(三幅图各占比例为50%、25%、25%)
MySQL触发器如何创建与删除