当前位置:网站首页>mysql数据库的基本操作(二)-——基于数据表
mysql数据库的基本操作(二)-——基于数据表
2022-07-27 21:59:00 【*黑心萝卜三条杠*】
1.创建数据表
create table +名字+(字段 字段定义);
如:我需要创建storage1表,字段为name、passwd、money,那我的命令及结果如下

2.显示数据表
(1).显示当前数据库中的数据表
show tables;例如,我需要显示全部的数据表,那我的命令及运行结果如下

(2).显示指定数据库中数据表
show table form +表名;例如:我需要显示数据库test1中的数据表,那我的命令及运行结果如下
3. 查看数据表
//方式1
desc +表名;
//方式2
describe +表名;
//方式3
show columns from +表名
例如:我想要显示表t1中的数据,那我的命令及运行结果如下

(注:由于三种显示方式差别不大,因此其他两种方式小编不做演示。)
4.更改数据表名
rename table 旧名 to 新名;例如:我想要更改t1的名字,那我的命令及结果运行如下

5.更改表编码
alter table +表名 charset +格式;例如:我需要将表student2的格式改成gbk格式,那我的命令及结果如下

6.删除数据表
drop table +表名;例如:我需要删除表student2,那我的命令及结果如下

边栏推荐
- 二舅治好我的精神内耗,也让我火出了B站
- 永州二恶英实验室建设细节查看
- OpenVINO整合TensorFlow实现推理加速
- 《数字经济 科技向善》大咖对谈干货来啦
- R语言R原生plot函数和lines函数的主要参数说明、解析(type、pch、cex、lty、lwd、col、xlab、ylab)
- 理解双亲委派模式
- Intensive reading of deep learning papers [gan]: multi-purpose image restoration and processing using depth generation priors
- Y79. Chapter IV Prometheus' monitoring system and practice -- Prometheus' service discovery mechanism (10)
- [must read for new products] valuation analysis of Meishi technology, distributed audio-visual products and Solutions
- Openvino integrates tensorflow to accelerate reasoning
猜你喜欢

Intel AI practice day issue 56 | explore new trends in industry development

What are the namespaces and function overloads of + and @ in front of MATLAB folder

学yolo需要什么基础?怎么学YOLO?

Matlab | those matlab tips you have to know (2)

ADB path cannot contain 2 spaces remote could n't create file: is a directory

Implement Gobang game with C language

千万播放竟有通用公式?B站被小看的爆款机会!

元宇宙的应用场景展示

Matlab | those matlab tips you have to know (4)

Introduction to thesis writing | how to write an academic research paper
随机推荐
永州水质检测实验室建设:家具说明
A few lines of code can easily realize the real-time reasoning of paddleocr. Come and get!
『百日百题 · 基础篇』备战面试,坚持刷题 第三话——分支语句!
Harmonyos 3 pure mode can limit the access to personal data of risk applications detected in Huawei's application market
leetcode 452. Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球(中等)
看知名企业们如何利用 Web3进行产业重塑
What are the namespaces and function overloads of + and @ in front of MATLAB folder
R语言R原生plot函数和lines函数的主要参数说明、解析(type、pch、cex、lty、lwd、col、xlab、ylab)
Implement Gobang game with C language
Y79. Chapter IV Prometheus' monitoring system and practice -- Prometheus' service discovery mechanism (10)
小程序助力智能家居生态平台
[meetup preview] openmldb + ONEFLOW: link feature engineering to model training to accelerate machine learning model development
code review 工具
Remote monitoring of pump station
C event related exercise code.
[21 day learning challenge] classmate K invites you to participate in the in-depth learning seminar
Csdn21 day learning challenge
理解双亲委派模式
Oracle password expiration solution
What a beautiful rainbow