当前位置:网站首页>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
边栏推荐
- 端午节快乐Wish Dragon Boat Festival is happy
- My seven years with NLP
- Machine learning plant leaf recognition
- Changes in the number of words in English papers translated into Chinese
- 【软件测试进阶第1步】自动化测试基础知识
- Leetcode - 152 product maximum subarray
- Redis Foundation
- Today's summer solstice
- Thesis abstract translation, multilingual pure human translation
- LeetCode 729. My schedule I
猜你喜欢
CS通过(CDN+证书)powershell上线详细版
Every API has its foundation when a building rises from the ground
CS passed (cdn+ certificate) PowerShell online detailed version
Today's summer solstice
Transfert des paramètres de la barre d'adresse de la page de liste basée sur jeecg - boot
My daily learning records / learning methods
Fedora/rehl installation semanage
[ 英语 ] 语法重塑 之 英语学习的核心框架 —— 英语兔学习笔记(1)
如何做好互联网金融的英语翻译
E-book CHM online CS
随机推荐
红蓝对抗之流量加密(Openssl加密传输、MSF流量加密、CS修改profile进行流量加密)
The internationalization of domestic games is inseparable from professional translation companies
Address bar parameter transmission of list page based on jeecg-boot
成功解决TypeError: data type ‘category‘ not understood
[English] Grammar remodeling: the core framework of English Learning -- English rabbit learning notes (1)
Market segmentation of supermarket customers based on purchase behavior data (RFM model)
How to do a good job in financial literature translation?
LeetCode 731. My schedule II
SSO流程分析
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
Day 246/300 SSH connection prompt "remote host identification has changed!"
[web security] nodejs prototype chain pollution analysis
生物医学本地化翻译服务
How effective is the Chinese-English translation of international economic and trade contracts
LeetCode每日一题(1870. Minimum Speed to Arrive on Time)
Engineering organisms containing artificial metalloenzymes perform unnatural biosynthesis
Every API has its foundation when a building rises from the ground
Brief introduction to the curriculum differences of colleges and universities at different levels of machine human major -ros1/ros2-
(practice C language every day) reverse linked list II
How do programmers remember code and programming language?