当前位置:网站首页>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
边栏推荐
- MySQL high frequency interview 20 questions, necessary (important)
- 详解SQL中Groupings Sets 语句的功能和底层实现逻辑
- 成功解决TypeError: data type ‘category‘ not understood
- Defense (greed), FBI tree (binary tree)
- [ 英語 ] 語法重塑 之 動詞分類 —— 英語兔學習筆記(2)
- mysql的基础命令
- Reflex WMS medium level series 3: display shipped replaceable groups
- [English] Grammar remodeling: the core framework of English Learning -- English rabbit learning notes (1)
- 一文读懂简单查询代价估算
- CS通过(CDN+证书)powershell上线详细版
猜你喜欢

How much is the price for the seal of the certificate

云上有AI,让地球科学研究更省力

论文摘要翻译,多语言纯人工翻译

机器人类专业不同层次院校课程差异性简述-ROS1/ROS2-

Wish Dragon Boat Festival is happy

Classification des verbes reconstruits grammaticalement - - English Rabbit Learning notes (2)

What are the characteristics of trademark translation and how to translate it?

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

Every API has its foundation when a building rises from the ground
![[ 英语 ] 语法重塑 之 动词分类 —— 英语兔学习笔记(2)](/img/3c/c25e7cbef9be1860842e8981f72352.png)
[ 英语 ] 语法重塑 之 动词分类 —— 英语兔学习笔记(2)
随机推荐
Address bar parameter transmission of list page based on jeecg-boot
P5706 [deep foundation 2. Example 8] redistributing fat house water -- February 13, 2022
What are the commonly used English words and sentences about COVID-19?
我的创作纪念日
A 27-year-old without a diploma, wants to work hard on self-study programming, and has the opportunity to become a programmer?
接口自动化测试实践指导(上):接口自动化需要做哪些准备工作
Day 245/300 JS forEach 多层嵌套后数据无法更新到对象中
CS通过(CDN+证书)powershell上线详细版
Luogu p2089 roast chicken
成功解决AttributeError: Can only use .cat accessor with a ‘category‘ dtype
26岁从财务转行软件测试,4年沉淀我已经是25k的测开工程师...
如何做好互联网金融的英语翻译
Tms320c665x + Xilinx artix7 DSP + FPGA high speed core board
Office doc add in - Online CS
[brush questions] how can we correctly meet the interview?
CS passed (cdn+ certificate) PowerShell online detailed version
Engineering organisms containing artificial metalloenzymes perform unnatural biosynthesis
如何将flv文件转为mp4文件?一个简单的解决办法
Classification des verbes reconstruits grammaticalement - - English Rabbit Learning notes (2)
Fedora/rehl installation semanage