当前位置:网站首页>mySql data view
mySql data view
2022-08-01 00:14:00 【face to face】
携手创作,共同成长!这是我参与「掘金日新计划 · 8 月更文挑战」的第4天,点击查看活动详情
一、 数据视图
视图是原始数据库数据的一种变换,是查看表中数据的另外一种方式.We can think of the view as a moving window,Data of interest can be seen from this window.
二、Data View Operations
创建视图
// 标准语法: CREATE VIEW 视图名称 [(列名列表)] AS 查询语句;
// 创建city_country视图,保存城市和国家的信息(使用指定列名)
CREATE VIEW city_country(city_id,city_name,country_name)
AS
SELECT c1.id, c1.name, c2.name FROM city c1, country c2 WHERE c1.cid = c2.id;
复制代码修改视图数据
// 标准语法: UPDATE 视图名称 SET 列名=值 WHERE 条件;
// 注意:修改视图数据后,源表中的数据也会随之修改
UPDATE city_country SET city_name="深圳" WHERE city_name="北京";
复制代码Modify view listings
// 标准语法: ALTER VIEW 视图名称 (列名列表) AS 查询语句;
ALTER VIEW city_country (city_id, city_name, NAME) AS
SELECT c1.id, c1.name, c2.name
FROM city c1, country c2
WHERE c1.cid = c2.id;
复制代码删除视图
// 标准语法 DROP VIEW [IF EXISTS] 视图名称;
// 删除city_country视图
DROP VIEW IF EXISTS city_country;
复制代码三、数据的备份与回复
liunx备份
- 备份文件
mysqldump -u root -p 数据库名称 > 文件保存路径
复制代码- 还原
source 文件保存路径
复制代码mysql备份
备份-> Export the backup database 还原-> 导入备份文件
四、
未完待续....
边栏推荐
- C# Rectangle基本用法和图片切割
- NIO programming
- How to Design High Availability and High Performance Middleware - Homework
- Weekly Summary
- Thinking and Implementation of Object Cache Service
- [Microservice] Distributed Transaction Solution - Seata
- Carefully summarize thirteen suggestions to help you create more suitable MySQL indexes
- lua入门案例实战123DIY
- 一行代码解决CoreData托管对象属性变更在SwiftUI中无动画效果的问题
- pycaret源码分析:下载数据集\Lib\site-packages\pycaret\datasets.py
猜你喜欢

面试突击69:TCP 可靠吗?为什么?

UOS统信系统 - WindTerm使用

NIO programming

pycaret源码分析:下载数据集\Lib\site-packages\pycaret\datasets.py

pycaret source code analysis: download dataset\Lib\site-packages\pycaret\datasets.py

谷歌『云开发者速查表』;清华3D人体数据集;商汤『通用视觉框架』公开课;Web3极简入门指南;高效深度学习免费书;前沿论文 | ShowMeAI资讯日报

Rainbow share | how to use moving targets defense technology to guard against the unknown

编译型语言和解释型语言的区别

Recommendation system: Summary of common evaluation indicators [accuracy rate, precision rate, recall rate, hit rate, (normalized depreciation cumulative gain) NDCG, mean reciprocal ranking (MRR), ROC

Carefully summarize thirteen suggestions to help you create more suitable MySQL indexes
随机推荐
内核对设备树的处理
面试突击69:TCP 可靠吗?为什么?
/etc/sysconfig/network-scripts configure the network card
UOS - WindTerm use
mysql having的用法
日常--Kali开启SSH(详细教程)
新产品如何进行网络推广?
Matlab / Arcgis处理nc数据
Shell common script: Nexus batch upload local warehouse script
Pylint检查规则中文版
Binary tree traversal non-recursive program -- using stack to simulate system stack
WindowInsetsControllerCompat is simple to use
Xinao Learning Plan The Road to Informatics Competition (2022.07.31)
2022年最新重庆建筑八大员(电气施工员)模拟题库及答案
Carefully summarize thirteen suggestions to help you create more suitable MySQL indexes
pycaret源码分析:下载数据集\Lib\site-packages\pycaret\datasets.py
[微服务]分布式事务解决方案-Seata
SQL注入 Less42(POST型堆叠注入)
vim的基本使用-底行模式
Keil nRF52832 download failed