当前位置:网站首页>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
边栏推荐
- [Cloud native] Open source data analysis SPL easily copes with T+0
- 最新MySql安装教学,非常详细
- NFTs: The Heart of Digital Ownership
- Kubernetes certificate validity period modification
- Yuan prospect and four track of the universe
- Eternal blue bug reappears
- 12 【网页布局总结 元素的显示与隐藏】
- leetcode-每日一题558. 四叉树交集(分治递归)
- 碎片化NFT(Fractional NFT)
- gin框架学习-JWT认证
猜你喜欢

02 【el和data的两种写法 MVVM模型】

Common JVM interview questions and answers

mysql password modification method in Linux (pro-test available)

leetcode-每日一题565. 数组嵌套(标记图和并查集)

What is the difference between NFT and digital collection?

leetcode-每日一题735. 行星碰撞(栈模拟)

vulhub靶场学习日记hackme1

vulhub靶场学习日记xxe-lab

Linux中mysql密码修改方法(亲测可用)

最新MySql安装教学,非常详细
随机推荐
Judgment of database in SQL injection
On the side of Ali, tell me what are the application scenarios of message middleware you know?
Xiaobai learns reptiles - introduction to reptiles
12 【nextTick 过渡与动画】
元宇宙的前景及四大赛道
Redis first meeting
Digital twins will be an important way to enter the "metaverse"
let和const命令
【uiautomation】微信好友列表获取(存储到txt中)
MySQL compressed package installation, fool teaching
Eternal blue bug reappears
C language tutorial (2) - printf and data types that come with c
[windows]--- SQL Server 2008 super detailed installation tutorial
数字孪生将成为进入“元宇宙”一项重要的途径
DeFi Token in the project management
What is the difference between NFT and digital collection?
uni-app进阶之自定义【day13】
C language tutorial (3) - if and loop
常见JVM面试题及答案整理
mysql password modification method in Linux (pro-test available)