当前位置:网站首页>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
边栏推荐
- Linux修改MySQL数据库密码
- feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
- 字符串的新增方法
- 08 【生命周期 组件】
- 2021 Mianjing - Embrace Change
- leetcode-2321. 拼接数组的最大分数(差分+枚举)
- MySQL分页查询的5种方法
- 【windows】--- SQL Server 2008 超详细安装教程
- Linux modify MySQL database password
- 02 【el和data的两种写法 MVVM模型】
猜你喜欢
05 【绑定样式 条件渲染 列表渲染】
mysql password modification method in Linux (pro-test available)
Yuan prospect and four track of the universe
Memcached :安装
If the account number or password is entered incorrectly for many times, the account will be banned.
vulhub靶场学习日记SickOs1.2
碎片化NFT(Fractional NFT)
uni-app进阶之样式框架/生产环境【day10】
10 【组件编码流程 组件自定义事件 全局事件总线】
MySQL compressed package installation, fool teaching
随机推荐
字符串的新增方法
04 【计算属性 侦听属性】
元宇宙的前景及四大赛道
Fragmented NFT (Fractional NFT)
11 【定位】
leetcode-829. 连续整数求和(数论)
13 【代理配置 插槽】
Linux修改MySQL数据库密码
碎片化NFT(Fractional NFT)
mysql启动报错The server quit without updating PID file几种解决办法
【swagger关闭】生产环境关闭swagger方法
在kali上搭建vulhub漏洞靶场
gin框架学习-Casbin入门指南(ACL、RBAC、域内RBAC模型)
What is the difference between NFT and digital collection?
leetcode-每日一题873. 最长的斐波那契子序列的长度(哈希和二分)
feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
带你搞懂MySQL隔离级别,两个事务同时操作同一行数据会怎样?
【C语言趣味小游戏——猜数字】
【Elastic-Job】分布式调度任务概览篇
uni-app进阶之内嵌应用【day14】