当前位置:网站首页>When I forget how to write SQL, I
When I forget how to write SQL, I
2022-07-04 10:21:00 【Java full stack preacher】
When I forget SQL How to write , I ……

What I used to be , Open the computer Baidu , Open the notes for a round of inquiry , I didn't find what I wanted most . Learn how to learn MySQL
Don't panic , No big problem

It turned out MySQL It comes with help documents .
So I had a meal to operate :win+R >> mysql -uroot -p >> Enter :?
result : The face is as green as the words in the picture , I can't understand what chicken intestines are written

I can't understand. It's OK , Teach now

Explain through chestnuts

For example, modify the table field name , I remember this order , yes , yes alter forehead , I just remember it was alter 了
No big problem , Do you remember alter

First step : Ask next alter,alter How to use it?
? alter
The second step : Ask again alter table
? alter table
So this version (5.7.27) I won't support it …… So you use rename There is no way to modify the field name .
When I change mysql 8.0.27 after , See support rename Grammar is like this , More than a bar ……


The third step : Merge grammar
Summon the snake skin monster
alter table tbl_name rename column old_col_name to new_col_name;Test it , See if the fit succeeds

Hey 、 As if , I got hold of MySQL help file
In case 、 I forgot how to spell alter 了 , What do I do ?
Ask no questions ??? Slightly , Look at the picture and see how to ask

Data Definition (DDL Data definition statement )
Data Manipulation (DML Data operation statement )
Data Types ( data type )See here is not an instant understand it ,DDL and DML All found .
pursuant to an inquiry , You see , This is back to the first step before

Only this and nothing more , You have mastered how to catch fish at work . Teaching a man to fish is better than giving him a fish !!

Pay attention to the official account, learn more about the knowledge of the database and get the database free e-book. .

边栏推荐
- Kotlin 集合操作汇总
- leetcode1-3
- PHP代码审计3—系统重装漏洞
- 【Day2】 convolutional-neural-networks
- 原生div具有编辑能力
- 用数据告诉你高考最难的省份是哪里!
- Exercise 7-4 find out the elements that are not common to two arrays (20 points)
- Exercise 7-8 converting strings to decimal integers (15 points)
- 按键精灵打怪学习-识别所在地图、跑图、进入帮派识别NPC
- Some summaries of the third anniversary of joining Ping An in China
猜你喜欢

Introduction to extensible system architecture
如果不知道這4種緩存模式,敢說懂緩存嗎?

Rhcsa12

C language pointer interview question - the second bullet

Baidu R & D suffered Waterloo on three sides: I was stunned by the interviewer's set of combination punches on the spot

If the uniapp is less than 1000, it will be displayed according to the original number. If the number exceeds 1000, it will be converted into 10w+ 1.3k+ display

Hands on deep learning (38) -- realize RNN from scratch

Reprint: summation formula of proportional series and its derivation process
What are the advantages of automation?

uniapp 小于1000 按原数字显示 超过1000 数字换算成10w+ 1.3k+ 显示
随机推荐
If the uniapp is less than 1000, it will be displayed according to the original number. If the number exceeds 1000, it will be converted into 10w+ 1.3k+ display
El Table Radio select and hide the select all box
用数据告诉你高考最难的省份是哪里!
Hands on deep learning (46) -- attention mechanism
Container cloud notes
Latex error: missing delimiter (. Inserted) {\xi \left( {p,{p_q}} \right)} \right|}}
Native div has editing ability
Idea SSH channel configuration
今日睡眠质量记录78分
Kotlin 集合操作汇总
Hands on deep learning (45) -- bundle search
【Day1】 deep-learning-basics
Normal vector point cloud rotation
Check 15 developer tools of Alibaba
Advanced technology management - how to design and follow up the performance of students at different levels
RHCE - day one
2021-08-11 function pointer
leetcode1-3
Occasional pit compiled by idea
uniapp---初步使用websocket(长链接实现)