当前位置:网站首页>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. .

边栏推荐
- Qtreeview+ custom model implementation example
- If you don't know these four caching modes, dare you say you understand caching?
- RHCE - day one
- Online troubleshooting
- Button wizard business running learning - commodity quantity, price reminder, judgment Backpack
- C language pointer interview question - the second bullet
- Hands on deep learning (40) -- short and long term memory network (LSTM)
- Talk about scalability
- Baidu R & D suffered Waterloo on three sides: I was stunned by the interviewer's set of combination punches on the spot
- Rhcsa operation
猜你喜欢

Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 2

BGP advanced experiment

Tables in the thesis of latex learning

Fabric of kubernetes CNI plug-in

Idea SSH channel configuration

Hands on deep learning (37) -- cyclic neural network

Hands on deep learning (45) -- bundle search

OSPF comprehensive experiment

转载:等比数列的求和公式,及其推导过程

C language pointer classic interview question - the first bullet
随机推荐
Ruby时间格式转换strftime毫秒匹配格式
System.currentTimeMillis() 和 System.nanoTime() 哪个更快?别用错了!
Modules golang
C language pointer classic interview question - the first bullet
【Day2】 convolutional-neural-networks
Pcl:: fromrosmsg alarm failed to find match for field 'intensity'
Exercise 9-5 address book sorting (20 points)
System. Currenttimemillis() and system Nanotime (), which is faster? Don't use it wrong!
Reasons and solutions for the 8-hour difference in mongodb data date display
使用 C# 提取 PDF 文件中的所有文字(支持 .NET Core)
Kotlin: collection use
【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
Basic principle of servlet and application of common API methods
Kotlin set operation summary
Realsense of d435i, d435, d415, t265_ Matching and installation of viewer environment
PHP code audit 3 - system reload vulnerability
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
Introduction to extensible system architecture
leetcode1-3
View CSDN personal resource download details