Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of viewing field attribute values by mysql

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to view field attribute values in mysql. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Mysql to view field attribute values: 1, query the properties of all fields in a database [table_schema= 'database name']; 2, query the properties of all fields in the specified database specified in the database [table_schema= 'database name' and table_name=].

How mysql looks at the values of field properties:

1. Query the attributes of all fields in a database (specify the database name). If you want to query all the fields without where conditions, you can.

Select * from information_schema.columns where table_schema= 'database name'

2. Query the properties of all fields of the specified database in the specified database (specify the database name and table name).

Select * from information_schema.columns where table_schema= 'database name' and table_name = 'table name'

3. Query the attribute that a specific column condition in the database is a field name.

Select table_schema,table_name,column_name,column_type,column_comment from information_schema.columns where TABLE_SCHEMA=' database name 'and column_name =' field name'

4. Query specific columns in the database (such as field name, field type, length size, field comments, etc.)

Select table_schema,table_name,column_name,column_type,column_comment from information_schema.columns where table_schema= 'database name'

Table_schema: database library name

Table_name: table name

Column_name: field name

Column_type: field properties (including field type and length)

Column_comment: field comments (field description)

Data_type: field typ

Column_key: the primary key of the field (PRI primary key)

Is_nullable: whether the field is empty

This is the end of mysql's method of viewing field attribute values. I hope the above content can be of some help to you and can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report