【学习笔记】PostgreSQL创建和删除表
创建表
- 基本语法
CREATE TABLE tablename(
column1 datatype,
column2 datatype,
column3 datatype,.....
columnN datatype,PRIMARY KEY( one or more columns ));
示例:
create table student(
id integer not null,
name varchar(20),
subject varchar(20),
constraint student_pkey primary key(id));

删除表
只需要一句语法就够了:
drop table student2;

浙公网安备 33010602011771号