openGauss数据库的基本操作(增删改查....)
1创建用户create user 用户名 with password 用户密码;2创建数据库create database 数据库名 owner 用户名;3进入数据库gsql -d 数据库名 -p 15400 -r4创建表create table 表名 (字段名 字段类型,字段名 字段类型); 例create table mytable (number int,year int);5向表中添加数据insert into 表名 values (字段值,字段值); 例insert into mytable values (1,100),(2,200);6查看数据表select * from 表名;7修改表中数据update 表名 set 字段修改后的字段值 where 字段字段值; 例update mytable set year300 where number2;8删除数据表中的数据delete 表名 where 字段字段值; 例delete mytable where number1;9增加表中的字段alter table 表名 add 字段 字段名; 例1alter table mytable add country char; 例2alter table mytable add mail char(20);10退出数据库\q11查看所有用户\du12查看所有数据库\l