操作数据库对象
1. 创建数据库
create database db_yhy with owner = postgres encoding = ‘utf-8’;
alter database db_yhy rename to db_yihengye;
drop database db_yihengye;
操作数据表对象
1. 创建数据表对象
crate table student(id int, name varchar(30), score numeric(5,2);
2. 修改数据表对象
alter table student rename to student1;
alter table student1 drop column birthday;
3. 删除数据表对象
drop table student1;数据表不存在时会报错
drop table if exists student1; 数据表不存在时会提示不存在,不报错
alter table student1 add column address varchar(200);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。