openGauss下的操作指令【华为根技术】
1、创建一张表 products
字段名 | 数据类型 | 含义 |
---|---|---|
product_id | integer | 产品编号 |
product_name | char(30) | 产品名 |
category | char(20) | 种类 |
----建表语句
create table products
( product_id integer,
product_name char(30),
category char(20)
) ;
----查看表的结构
omm=# \d products
2、向表中插入数据,分别采用一次插入一条和一次插入多条记录的方式
insert into products(product_id,product_name,category) values (1502, ‘olympus camera’, ‘electrncs’);
insert into products(product_id,product_name,category) values
(1601,‘lamaze’,‘toys’),
(1700,‘wait interface’,‘Books’),
(1666,‘harry potter’,‘toys’);
3、查询表中所有记录及记录数
select count(*) from products;
select * from products;
4、查询表中所有category记录,并将查询结果按升序排序
select category from products order by category asc;
5、查询表中category为toys的记录
select * from products where category = ‘toys’;
6、更改表中某个字段的值
update products set product_name=‘camera’ where product_id=1502;
select * from products;
6、删除表products
drop table products;
select * from products;
总结
openGauss数据库作为一款基于SQL标准的关系型数据库管理系统,支持广泛的SQL指令进行数据操作、查询、管理以及权限控制。OpenGauss提供面向多核的极致性能、全链路的业务和数据安全、基于AI的调优和高效运维的能力让我受益匪浅。尤其是OpenGauss在AI自治方面的能力真是令人惊喜。自调优、自诊断自愈、自组装这三大自治简直是所有dba的福音。
- 随机文章
- 热门文章
- 热评文章
- 全面解析游戏性能测试软件:原理、工具与应用游戏性能测试软件哪个好
- 门萨智商测试题:探索门萨俱乐部入门智商评估测试题的奥秘门萨智商测试
- 普通话水平测试用普通话词语表普通话水平测题
- 北京的秋天普通话60篇朗读原文免费
- 测一测你的性格跟《河神2》中的谁最像
- 抑郁测试 心理测试抑郁程度
- 弹性公网IP:云时代的”智能通讯管家“
- Latex技巧--表格相关操作
- Java MVC 博客系统