In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you the method of creating data tables in mysql database. I hope you will get something after reading this article. Let's discuss it together.
Mysql's method of creating a data table: use the sql general syntax [CREATE TABLE table_name (column_name column_type);] to create a successful datasheet.
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 tbl in the RUNOOB database:
CREATE TABLE IF NOT EXISTS `tbl` (`id` INT UNSIGNED AUTO_INCREMENT, `title` VARCHAR (100) NOT NULL, `author` VARCHAR (40) NOT NULL, `submission_ date`DATE, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8
Parsing:
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 the column primary key. You can use multiple columns to define the primary key, separated by commas.
ENGINE sets the storage engine and CHARSET sets the encoding.
After reading this article, I believe you have a certain understanding of "the method of creating data tables in mysql database". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
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.