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--
This article mainly introduces how to write the mysql table sentence, which has a certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
The table-building statement in mysql is [CREATE TABLE table_name (column_name column_type);]. Column_name represents the field name, and column_type represents the field type.
Syntax:
CREATE TABLE table_name (column_name column_type)
For example:
We will create the data table run_tbl in the RUN database:
CREATE TABLE IF NOT EXISTS `run_ tbl` (`run_ id` INT UNSIGNED AUTO_INCREMENT, `run_ title` VARCHAR (100) NOT NULL, `run_ author` VARCHAR (40) NOT NULL, `submission_ date` DATE, PRIMARY KEY (`run_ 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 the storage engine and CHARSET sets the encoding.
Thank you for reading this article carefully. I hope it will be helpful for everyone to share how to write mysql sentences. At the same time, I also hope you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you 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.
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.