暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

openGauss每日一练第6天 | 学习心得体会

原创 葛二萌 2021-12-06
219

作业内容

  • 创建一个名为tpcds的模式
create schema tpcds;
  • 创建一个用户tim, 并将tpcds的owner修改为tim,且修改owner前后分别使用\dn+查看模式信息
create user tim identified by 'test_123';
\dn+ tpcds
alter schema tpcds owner to tim;
\dn+ tpcds

image.png

  • 在模式tpcds中建表customer、插入记录和查询记录
create table tpcds.test(id integer,name char(10));
insert into tpcds.test values(1,'gem');
select * from tpcds.test;

image.png

  • 重命名tpcds为tpcds1
alter schema tpcds rename to tpcds1;
  • 删除模式tpcds1
drop schema tpcds1;

学习体会

  • 今天第六天,学习了openGauss创建模式、修改模式属性和删除模式,模式是一组数据库对象的集合,主要用于控制对数据库对象的访问,例如,表是属于模式的,创建在模式下面,模式操作相关的语句,create schema(创建模式) , owner to(指定模式属主) ,rename to(重命名) ,表名需要用模式名.表名来表示。继续加油!
最后修改时间:2021-12-06 10:42:50
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论