当前位置:网站首页>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
边栏推荐
- Build DVWA with phpstudy
- 工件SSMwar exploded 部署工件时出错。请参阅服务器日志了解详细信息
- npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案
- find、filter、map的区别
- 数字取证autopsy工具用法
- vulhub靶场学习日记SickOs1.2
- GUCCI, LV and other luxury giant universe how to layout yuan, other brands should keep up with?
- 初涉C语言
- 变量的解构赋值
- vulhub靶场学习日记hackme2
猜你喜欢
随机推荐
uni-app进阶之认证【day12】
【Elastic-Job源码分析】——作业监听器
Digital twins will be an important way to enter the "metaverse"
[Elastic-Job] Overview of Distributed Scheduling Tasks
Linux修改MySQL数据库密码
[Elastic-Job source code analysis] - job listener
vulhub靶场学习日记SickOs1.2
Install mysqldb in mac10.14
Redis:安装使用
vulhub靶场学习日记hackme1
04 【计算属性 侦听属性】
About integrating superset into your own project
Memcached :安装
sqlmap injection tutorial common commands
tf.keras.utils.pad_sequences()
联盟链的真实场景在哪里
GUCCI、LV等奢侈品巨头如何布局元宇宙的,其他品牌应该跟上吗?
07 【内置指令 自定义指令】
leetcode-每日一题565. 数组嵌套(标记图和并查集)
最新MySql安装教学,非常详细









