当前位置:网站首页>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
边栏推荐
- Modify the list page on the basis of jeecg boot code generation (combined with customized components)
- [ 英语 ] 语法重塑 之 英语学习的核心框架 —— 英语兔学习笔记(1)
- [unity] how to export FBX in untiy
- Day 239/300 注册密码长度为8~14个字母数字以及标点符号至少包含2种校验
- Apache dolphin scheduler source code analysis (super detailed)
- 论文翻译英译中,怎样做翻译效果好?
- Grouping convolution and DW convolution, residuals and inverted residuals, bottleneck and linearbottleneck
- Traffic encryption of red blue confrontation (OpenSSL encrypted transmission, MSF traffic encryption, CS modifying profile for traffic encryption)
- 成功解决TypeError: data type ‘category‘ not understood
- Reflex WMS中阶系列3:显示已发货可换组
猜你喜欢

My daily learning records / learning methods

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

Market segmentation of supermarket customers based on purchase behavior data (RFM model)

Traffic encryption of red blue confrontation (OpenSSL encrypted transmission, MSF traffic encryption, CS modifying profile for traffic encryption)

University of Manchester | dda3c: collaborative distributed deep reinforcement learning in swarm agent systems

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

红蓝对抗之流量加密(Openssl加密传输、MSF流量加密、CS修改profile进行流量加密)

LeetCode 731. My schedule II

Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL

生物医学本地化翻译服务
随机推荐
Biomedical localization translation services
Simple query cost estimation
关于新冠疫情,常用的英文单词、语句有哪些?
钓鱼&文件名反转&office远程模板
Office doc add in - Online CS
Automated test environment configuration
L'Ia dans les nuages rend la recherche géoscientifique plus facile
Fedora/rehl installation semanage
字幕翻译中翻英一分钟多少钱?
CS-证书指纹修改
pymongo获取一列数据
Making interactive page of "left tree and right table" based on jeecg-boot
MySQL high frequency interview 20 questions, necessary (important)
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
如何做好金融文献翻译?
Day 245/300 JS forEach 多层嵌套后数据无法更新到对象中
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
Pallet management in SAP SD delivery process
【刷题】怎么样才能正确的迎接面试?
Successfully solved typeerror: data type 'category' not understood