In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The purpose of this article is to share with you about what the syntax for creating tables is in mysql. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
The table-building statement in mysql is: [CREATE TABLE table_name (column_name column_type);]. For example, we want to create a new phpcn_tb table with the following syntax: [CREATE TABLE `phpcn_ tb`].
General SQL syntax for creating MySQL data tables:
CREATE TABLE table_name (column_name column_type)
For example:
CREATE TABLE `phpcn_ tb` (`phpcn_ id` INT UNSIGNED AUTO_INCREMENT, `phpcn_ title` VARCHAR (100) NOT NULL, `phpcn_ author` VARCHAR (40) NOT NULL, `submission_ date` DATE, PRIMARY KEY (`phpcn_ id`) ENGINE=InnoDB DEFAULT CHARSET=utf8
Description:
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 up the storage engine.
CHARSET sets the encoding.
Thank you for reading! So much for sharing the syntax of table building in mysql. I hope the above content can be helpful to you so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.
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.