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

openGauss每日一练第 13 天-实训作业

原创 Carton 2022-12-06
225

本文为第二届openGauss每日一练,21天打卡计划第 13 天的作业部分,课程内容总结如下openGauss每日一练第 13 天-列存表的概念与创建

作业1

创建一个表(默认,不指定模式),查看该表在那个模式下

creat table testtb1(col char(20)); select table_catalog, table_schema, table_name from information_schema.tables where table_name='testtb1';

image.png

作业2

在会话级设置模式搜索路径为:模式testsch1,使用SchemaName.TableName的表标识方法访问表(创建表、插入数据和查询表中数据)

set search_path to testsch1; create table testtable(col1 char(100)); create table testsch2.testtable(col1 char(100)); create table testsch3.testtable(col1 char(100)); insert into testtable values('hello testsch1'); insert into testsch2.testtable values('hello testsch1'); insert into testsch3.testtable values('hello testsch1'); select * from testtb; select * from testsch2.testtb; select * from testsch3.testtb;

image.png

作业3

使用一个用户连接到enmdb数据库,测试该用户可以访问不同模式中的表

\c enmdb user1 select * from testsch1.testtb; select * from testsch2.testtb; select * from testsch3.testtb;

image.png

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论