当前位置:网站首页>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
边栏推荐
- 万丈高楼平地起,每个API皆根基
- Tms320c665x + Xilinx artix7 DSP + FPGA high speed core board
- Phishing & filename inversion & Office remote template
- UniPro甘特图“初体验”:关注细节背后的多场景探索
- In English translation of papers, how to do a good translation?
- LeetCode 739. Daily temperature
- 国产游戏国际化离不开专业的翻译公司
- Day 245/300 JS foreach data cannot be updated to the object after multi-layer nesting
- My creation anniversary
- Distributed system basic (V) protocol (I)
猜你喜欢

Leetcode daily question (971. flip binary tree to match preorder traversal)

生物医学本地化翻译服务

Wish Dragon Boat Festival is happy

SQL Server manager studio(SSMS)安装教程

mysql的基础命令

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

翻译生物医学说明书,英译中怎样效果佳

专业论文翻译,英文摘要如何写比较好
![[ 英语 ] 语法重塑 之 动词分类 —— 英语兔学习笔记(2)](/img/3c/c25e7cbef9be1860842e8981f72352.png)
[ 英语 ] 语法重塑 之 动词分类 —— 英语兔学习笔记(2)

Bitcoinwin (BCW): 借贷平台Celsius隐瞒亏损3.5万枚ETH 或资不抵债
随机推荐
Data security -- 13 -- data security lifecycle management
今日夏至 Today‘s summer solstice
Apache dolphin scheduler source code analysis (super detailed)
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?
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
Automated test environment configuration
商标翻译有什么特点,如何翻译?
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
LeetCode 739. Daily temperature
基于购买行为数据对超市顾客进行市场细分(RFM模型)
[brush questions] how can we correctly meet the interview?
Simple query cost estimation
CS certificate fingerprint modification
云上有AI,让地球科学研究更省力
如何做好金融文献翻译?
Tms320c665x + Xilinx artix7 DSP + FPGA high speed core board
Leetcode - 152 product maximum subarray
成功解决TypeError: data type ‘category‘ not understood
Delete external table source data