当前位置:网站首页>Simple use of MySQL database: add, delete, modify and query
Simple use of MySQL database: add, delete, modify and query
2022-07-06 06:46:00 【Lu__ xiao】
increase 、 Delete 、 Change 、 check
Mysql -u root -p Connect to database
show databases; view the database
create database xxx; establish xxx database
use xxx Use xxx database
create table result(id int(8),name varchar(20),city varchar(20),score int(5));
In the database student Create a table result
In the table resuit Insert 5 Data
insert into result(id,name,city,score) values(1,"wang","beijing",75);
insert into result(id,name,city,score) values(3,"li","shanghai",80);
insert into result(id,name,city,score) values(5,"chen","fuzhou",70);
insert into result(id,name,city,score) values(2,"zhou","xian",90);
insert into result(id,name,city,score) values(7,"han","guangzhou",65);
Be careful : If the data is character type (varchar), Must be wrapped in single or double quotation marks .
After successful insertion , You can use the following command to query result Everything in the table :
Select * from result;
In the table result Delete in id=3 The data of
delete from result where id=3;
modify id=5 The data of , Put it score Set to 60,
update result set score=60 where id=5;
select * from result; Query all fields in the table
select name,score from result; Look up name and score Field
select score from result where name="chen"; Inquire about name by chen Student scores
边栏推荐
- 利用快捷方式-LNK-上线CS
- [ 英语 ] 语法重塑 之 英语学习的核心框架 —— 英语兔学习笔记(1)
- SAP SD发货流程中托盘的管理
- E-book CHM online CS
- Lecture 8: 1602 LCD (Guo Tianxiang)
- My seven years with NLP
- Map of mL: Based on the adult census income two classification prediction data set (whether the predicted annual income exceeds 50K), use the map value to realize the interpretable case of xgboost mod
- 同事上了个厕所,我帮产品妹子轻松完成BI数据产品顺便得到奶茶奖励
- 金融德语翻译,北京专业的翻译公司
- 商标翻译有什么特点,如何翻译?
猜你喜欢
My daily learning records / learning methods
Modify the list page on the basis of jeecg boot code generation (combined with customized components)
What are the characteristics of trademark translation and how to translate it?
同事上了个厕所,我帮产品妹子轻松完成BI数据产品顺便得到奶茶奖励
红蓝对抗之流量加密(Openssl加密传输、MSF流量加密、CS修改profile进行流量加密)
Leetcode daily question (971. flip binary tree to match preorder traversal)
Summary of leetcode's dynamic programming 4
如何做好互联网金融的英语翻译
On the first day of clock in, click to open a surprise, and the switch statement is explained in detail
E-book CHM online CS
随机推荐
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Modify the list page on the basis of jeecg boot code generation (combined with customized components)
Office doc add in - Online CS
How do programmers remember code and programming language?
Distributed system basic (V) protocol (I)
CS certificate fingerprint modification
Thesis abstract translation, multilingual pure human translation
Biomedical localization translation services
商标翻译有什么特点,如何翻译?
Reflex WMS中阶系列3:显示已发货可换组
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用Shap值对XGBoost模型实现可解释性案例之详细攻略
金融德语翻译,北京专业的翻译公司
My daily learning records / learning methods
It is necessary to understand these characteristics in translating subtitles of film and television dramas
生物医学本地化翻译服务
雲上有AI,讓地球科學研究更省力
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
pymongo获取一列数据
Cobalt strike feature modification
翻译影视剧字幕,这些特点务必要了解