当前位置:网站首页>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
边栏推荐
- Suspended else
- Apache dolphin scheduler source code analysis (super detailed)
- AI on the cloud makes earth science research easier
- LeetCode - 152 乘积最大子数组
- AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
- How much is it to translate Chinese into English for one minute?
- 自动化测试环境配置
- 如何做好金融文献翻译?
- 接口自动化测试实践指导(上):接口自动化需要做哪些准备工作
- Leetcode daily question (971. flip binary tree to match preorder traversal)
猜你喜欢
英语论文翻译成中文字数变化
翻译公司证件盖章的价格是多少
万丈高楼平地起,每个API皆根基
Monotonic stack
Brief introduction to the curriculum differences of colleges and universities at different levels of machine human major -ros1/ros2-
[web security] nodejs prototype chain pollution analysis
My creation anniversary
My seven years with NLP
Suspended else
[unity] how to export FBX in untiy
随机推荐
字幕翻译中翻英一分钟多少钱?
云服务器 AccessKey 密钥泄露利用
Office-DOC加载宏-上线CS
ECS accessKey key disclosure and utilization
[ 英語 ] 語法重塑 之 動詞分類 —— 英語兔學習筆記(2)
MySQL high frequency interview 20 questions, necessary (important)
(practice C language every day) reverse linked list II
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用Shap值对XGBoost模型实现可解释性案例之详细攻略
My daily learning records / learning methods
Erreur de type résolue avec succès: type de données « catégorie» non sous - jacente
万丈高楼平地起,每个API皆根基
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
Number of query fields
How to translate professional papers and write English abstracts better
Leetcode - 152 product maximum subarray
UniPro甘特图“初体验”:关注细节背后的多场景探索
Chapter 7 - thread pool of shared model
基於JEECG-BOOT的list頁面的地址欄參數傳遞
Successfully solved typeerror: data type 'category' not understood
Day 248/300 thoughts on how graduates find jobs