当前位置:网站首页>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
边栏推荐
- 电子书-CHM-上线CS
- pymongo获取一列数据
- 红蓝对抗之流量加密(Openssl加密传输、MSF流量加密、CS修改profile进行流量加密)
- CS passed (cdn+ certificate) PowerShell online detailed version
- 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
- 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
- How much is it to translate Chinese into English for one minute?
- Chapter 7 - thread pool of shared model
- Py06 字典 映射 字典嵌套 键不存在测试 键排序
- It is necessary to understand these characteristics in translating subtitles of film and television dramas
猜你喜欢

Modify the list page on the basis of jeecg boot code generation (combined with customized components)

国产游戏国际化离不开专业的翻译公司

如何将flv文件转为mp4文件?一个简单的解决办法

Thesis abstract translation, multilingual pure human translation

LeetCode 729. My schedule I

How to translate professional papers and write English abstracts better

ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用Shap值对XGBoost模型实现可解释性案例之详细攻略

Suspended else

LeetCode每日一题(971. Flip Binary Tree To Match Preorder Traversal)

女生学软件测试难不难 入门门槛低,学起来还是比较简单的
随机推荐
[English] Grammar remodeling: the core framework of English Learning -- English rabbit learning notes (1)
翻译影视剧字幕,这些特点务必要了解
P5706 [deep foundation 2. Example 8] redistributing fat house water -- February 13, 2022
Fedora/REHL 安装 semanage
【刷题】怎么样才能正确的迎接面试?
How much is the price for the seal of the certificate
字幕翻译中翻英一分钟多少钱?
Cobalt Strike特征修改
Luogu p2089 roast chicken
Simple query cost estimation
Basic commands of MySQL
成功解决TypeError: data type ‘category‘ not understood
钓鱼&文件名反转&office远程模板
Day 245/300 JS foreach data cannot be updated to the object after multi-layer nesting
Day 239/300 注册密码长度为8~14个字母数字以及标点符号至少包含2种校验
SSO process analysis
Biomedical localization translation services
云上有AI,让地球科学研究更省力
pymongo获取一列数据
Grouping convolution and DW convolution, residuals and inverted residuals, bottleneck and linearbottleneck