当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
MySQL分页查询的5种方法
Memcached :安装
tf.keras.utils.pad_sequences()
Linux修改MySQL数据库密码
[JVM Loading]---Class Loading Mechanism
数字取证autopsy工具用法
字符串的扩展
The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered
Redis:简单实用
What is GameFi?
MySQL-如何分库分表?一看就懂
C language tutorial (3) - if and loop
闭包(三)----执行环境
leetcode-每日一题731. 我的日程安排表 II
uni-app进阶之自定义【day13】
Why is the redis single-threaded also so fast?
02 【el和data的两种写法 MVVM模型】
【ubuntu20.04安装MySQL以及MySQL-workbench可视化工具】
阿里一面,说说你知道消息中间件的应用场景有哪些?
leetcode-每日一题1217. 玩筹码(贪心+位运算)






![[Cloud native] Open source data analysis SPL easily copes with T+0](/img/89/4a96358956782ef9dacf0b700b54c3.png)