Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-view #11

Open
Selflocking opened this issue Oct 17, 2023 · 1 comment
Open

create-view #11

Selflocking opened this issue Oct 17, 2023 · 1 comment
Labels
20分 20分 medium 中等

Comments

@Selflocking
Copy link
Member

赛题描述

实现视图功能。

视图是数据库的基本功能之一。视图可以极大地方便数据库的使用。

视图,顾名思义,就是一个能够自动执行查询语句的虚拟表。

不过视图功能也非常复杂,需要考虑视图更新时如果更新实体表。如果视图对应了单张表,并且没有虚拟字段,更新视图,即更新了实体表。如果实体表中某些字段不在视图中,那此字段的结果应该是NULL或默认值。如果视图中包含虚拟字段,比如通过聚合查询的结果,或者视图关联了多张表,他的更新规则就变得复杂起来。在这些场景中,同学们可以参考MySQL的实现方案。

示例:

create view create_view_v4 as select t1.id as id, t1.age as age, t2.name as name from create_view_t1 t1, create_view_t2 t2 where t1.id=t2.id;

赛题地址

https://open.oceanbase.com/train/TopicDetails?questionId=600004&subQesitonId=800023&subQuestionName=create-view

@Selflocking Selflocking added easy 简单 medium 中等 20分 20分 and removed easy 简单 labels Oct 17, 2023
@Selflocking
Copy link
Member Author

IMG_20231106_025015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
20分 20分 medium 中等
Projects
None yet
Development

No branches or pull requests

1 participant