当前位置:网站首页>[MySQL learning 08]
[MySQL learning 08]
2022-07-25 11:41:00 【88 year old programming with injury】
mysql Study 08
Data creation 、 Modify and delete
1.1 A procedure for storing data

1.2 Identifier naming rules

1.3 The basic types of data

The commonly used data types are described as follows :
Create and manage databases
1. Create database 

2. Management database 
modify the database

Be careful :
Delete database

Method 2: delete the database if it exists , If it doesn't exist, it will end silently .
The code problem
View the default encoding format :show variables like “%char%”;
But it's still Chinese garbled 
Operations on tables
There are two ways to create tables
Mode one :

1. Use varchar To define a string , Must be in use varchar Indicate its length when .
2. If the character set is not specified when creating the table , The character set of the database where the table is located is used by default .
Mode two :
Based on existing tables .

1. Copy table ( Include table data ).
create table The new name of the table as select * from Table name already exists .
2. Copy table ( Excluding table data ).
create table The new name of the table as select * from Table name already exists
where 1=2;( Add a condition to filter ).
Modify table
Add a field
Basic grammar :alter table Table name add…;
The last two methods in the figure can adjust the field position .
Modify a field
Basic grammar :alter table Table name modify…;
among aaa Is the default value .
Rename a field
Basic grammar :alter table Table name change…; The old name comes first , New name after .

Delete a field
Basic grammar :alter table Table name drop column…;
rename table , Delete table , Clear the table
1. rename table 

2. Delete table 

3. Clear the table
Clear table data only , The structure of the watch is still 

DCL in commit and rollback




Ali mysql Naming conventions and mysql8DDL Atomization of




边栏推荐
- 苹果美国宣布符合销售免税假期的各州产品清单细节
- 基于cornerstone.js的dicom医学影像查看浏览功能
- WIZnet W5500系列培训活动之“MQTT协议讲解和实践(接入OneNET)”
- Understanding: idea uses Scala to write wordcount programs and generate jar packages
- shell- 第七章练习
- [IJCAI 2022] parameter efficient large model sparse training method, which greatly reduces the resources required for sparse training
- Nowcodertop1-6 - continuous updating
- 【mysql学习09】
- Breadth first traversal (problems related to sequence traversal of graphs and binary trees)
- 【电子器件笔记5】二极管参数和选型
猜你喜欢

全网显示 IP 归属地,是怎么实现的?

Learn Luzhi PHP -- tp5.0 uses Chinese as an alias and reports "unsupported data expression"

谣言检测文献阅读十一—Preventing rumor spread with deep learning

MySQL | GROUP_ The concat function concatenates the values of a column with commas

My colleague looked at my code and exclaimed: how can I use a singleton in unity

2022 年中回顾|一文看懂预训练模型最新进展

Want to record your supernatural moments when playing games? Let's take a look at how to use unity screenshots

矩阵的特征值和特征向量

SQL language (II)

SQL注入 Less23(过滤注释符)
随机推荐
圆角大杀器,使用滤镜构建圆角及波浪效果!
shell-第六章练习
[tree] 100. Same tree
黑客入门教程(非常详细)从零基础入门到精通,看完这一篇就够了。
Redis 入门
MLX90640 红外热成像仪测温模块开发笔记(五)
Stm32cubemx learning record -- installation, configuration and use
Detailed explanation of lvs-nat and lvs-dr modes of LVS load balancing
leetcode 剑指 Offer 28. 对称的二叉树
Signal and slot mechanism ==pyqt5
论文解读(MaskGAE)《MaskGAE: Masked Graph Modeling Meets Graph Autoencoders》
SQL注入 Less18(头部注入+报错注入)
Let sports happen naturally, and fire creates a new lifestyle
数据库设计-简化字典表[通俗易懂]
flinksql client 连接kafka select * from table没有数据报错,如何解决?
Game backpack system, "inventory Pro plug-in", research and learning ----- mom doesn't have to worry that I won't make a backpack anymore (unity3d)
信号与槽机制==PYQT5
Learn Luzhi PHP -- tp5.0 uses Chinese as an alias and reports "unsupported data expression"
How to judge the performance of static code quality analysis tools? These five factors must be considered
小区蔬菜配送的小程序