In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to operate the datasheet by MySQL". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to operate the datasheet with MySQL.
The method of manipulating the data table by MySQL is not complicated. Here is a detailed description of how to add fields, modify fields, delete fields, get table names and other operations in MYSQL. I hope it will be helpful for you to learn how to add fields in MySQL.
The method of adding fields in MySQL is not complicated. Here is a detailed description of how to add fields and modify fields in MYSQL. I hope it will be helpful for you to learn how to add fields in MySQL.
1 add table field
Alter table table1 add transactor varchar (10) not Null;alter table table1 add id int unsigned not Null auto_increment primary key
An example of a statement added after a specific field:
ALTER TABLE ADD [constraint]; ALTER TABLE MyTableName ADD newDBField varchar (30) NULL AFTER existDBField;ALTER TABLE tableName001 ADD WebAdminPass varchar (30) NULL AFTER Result
two。 Modify the field type of a table and specify it as empty or non-empty
Alter table table name change field name field name field type [allow non-null]; alter table table name modify field name field type [allow non-null]; alter table table name modify field name field type [allow non-null]
3. Modify the field name of a table and specify it as empty or non-empty
Alter table table name change field original name field new name field type [whether non-null is allowed
4 if you want to delete a field, you can use the command:
ALTER TABLE mytable DROP field name
Mysql SQL gets the query statement of table name & field name
1: query all table names in the database
Select table_name from information_schema.tables where table_schema='csdb' and table_type='base table';table_schema: the database name information_schema represents the system library. Table_type='base table': restricts querying only the base table.
2: query all field names of the specified table in the specified database column_name
Select column_name from information_schema.columns where table_schema='csdb' and table_name='users'; table_schema: database name table_name: table name
Examples of work are used:
Select count (*) from information_schema.columns where table_schema='yanfa' and table_name='tableName001' and column_name='Result1'; # select table_name from information_schema.tables where table_schema='yanfa' and table_type='base table'; so far, I believe you have a deeper understanding of "how MySQL operates the data table". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.