当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
2021 Mianjing - Embrace Change
12 【网页布局总结 元素的显示与隐藏】
wpf ScrowViewer水平滚动
GUCCI、LV等奢侈品巨头如何布局元宇宙的,其他品牌应该跟上吗?
年终总结——岁月静好~
Common JVM interview questions and answers
Flink sink redis writes to Redis
mysql启动报错The server quit without updating PID file几种解决办法
【数据库学习】Redis 解析器&&单线程&&模型
leetcode-每日一题1217. 玩筹码(贪心+位运算)
对于输出点是时间戳的渗透测试方法(以Oracle数据库为例)
字符串的新增方法
MySQL分页查询的5种方法
leetcode-每日一题745. 前缀和后缀搜索(哈希和字典树)
uni-app进阶之模版语法与数据绑定【day7】
闭包(五)----一个常见的循环
对递归的一些感悟
11 【组件通信】
(Crypto必备干货)详细分析目前NFT的几大交易市场
SQL注入中数据库的判断






![[JVM Loading]---Class Loading Mechanism](/img/b6/d1754cb6699d18602ca9a463571c0c.png)


