In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
What are the steps for mysql to create a data table? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
The following information is required to create an MySQL data table:
1. Table name
two。 Table field name
3. Define each table field
Grammar
The following is the general SQL syntax for creating MySQL data tables:
CREATE TABLE table_name (column_name column_type)
In the following example, we will create the data table runoob_tbl in the RUNOOB database:
CREATE TABLE IF NOT EXISTS `runoob_ tbl` (`runoob_ id` INT UNSIGNED AUTO_INCREMENT, `runoob_ title` VARCHAR (100) NOT NULL, `runoob_ author` VARCHAR (40) NOT NULL, `submission_ date` DATE, PRIMARY KEY (`runoob_ id`) ENGINE=InnoDB DEFAULT CHARSET=utf8
Instance resolution:
● if you do not want the field to be NULL, you can set the property of the field to NOT NULL. If you enter the data of the field as NULL when operating the database, you will report an error.
The ● AUTO_INCREMENT definition is listed as a self-increasing attribute, which is generally used for primary keys, and the value is automatically incremented by 1.
The ● PRIMARY KEY keyword is used to define column primary keys. You can use multiple columns to define the primary key, separated by commas.
● ENGINE sets the storage engine and CHARSET sets the encoding.
Thank you for reading! After reading the above, do you have a general understanding of the steps for mysql to create a datasheet? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.