当前位置:网站首页>MySql to create data tables
MySql to create data tables
2022-07-31 05:52:00 【m0_67391401】
Learn more MySql statements: https://blog.csdn.net/weixin_45761237/category_11726248.html?spm=1001.2014.3001.5482
Use create table to create a table
create table tablename([table definition options])[table options][partition options])
Create a student table with the following structure and content
Table structure
Field Name
Data Type
Notes
id
int
student id
name
varcher
Student name
age
int
Age
Table content
id
name
age
1
Zhao
15
2
money
16
3
Sun
18
Syntax
1. Create a table (simple)
CREATE TABLE student ( id INT ( 12 ), NAME VARCHAR ( 25 ), age INT ( 12 ) );
2. Create a table (delete the previous table first, and then execute this command, otherwise a conflict will occur)
Note: When creating a MySql table, the symbol ` outside the table name and field name is not a single quote, but an anti-single quote in the state of the English input method, which is the ~ button below the esc button in the upper left corner of the keyboard
p>CREATE TABLE IF NOT EXISTS `student` (`id` INT(12) UNSIGNED AUTO_INCREMENT COMMENT 'student id',`name` VARCHAR ( 255 ) NOT NULL COMMENT 'student name',`age` INT ( 12 ) COMMENT 'age',PRIMARY KEY ( `id` )) ENGINE = INNODB DEFAULT CHARSET = utf8;
UNSIGNED AUTO_INCREMENT means non-null auto-increment
PRIMARY KEY ( `id`) set id as primary key
ENGINE set storage engine
CHARSET sets the encoding
COMMENT comments
NOT NULL is not empty
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- 【JVM加载】---类加载机制
- 13 【代理配置 插槽】
- The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered
- On the side of Ali, tell me what are the application scenarios of message middleware you know?
- PAT_乙级_真题练习_1007_素数对猜想
- Digital twins will be an important way to enter the "metaverse"
- uni-app进阶之创建组件/原生渲染【day9】
- Linux modify MySQL database password
- Common JVM interview questions and answers
- leetcode-每日一题745. 前缀和后缀搜索(哈希和字典树)
猜你喜欢
随机推荐
【云原生】原来2020.0.X版本开始的OpenFeign底层不再使用Ribbon了
"limit" query in Oracle database
find、filter、map的区别
Redis管道技术/分区
MySQL压缩包方式安装,傻瓜式教学
C语言文件读、写、定位函数
The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered
Getting to know regular expressions
11 【定位】
闭包(三)----执行环境
leetcode-每日一题731. 我的日程安排表 II
Digital twins will be an important way to enter the "metaverse"
13 【代理配置 插槽】
1D, 2D, 3D convolution operations in pytorch
2021面经-拥抱变化
vulhub靶场学习日记SickOs1.2
Redis 事务学习有感
Linux修改MySQL数据库密码
初涉C语言
局部变量成员变量、引用类型、this,static(第五天)
![[windows]--- SQL Server 2008 super detailed installation tutorial](/img/b7/dc802c63b07edc4298b6e6b90d865c.png)








