FreeBSD使用PostgreSQL (二) 表的创建和删除
FreeBSD使用PostgreSQL (二) 表的创建和删除使用名为test的数据库:
%psql test
创建weather表:
CREATE TABLE weather (
city varchar(80),
temp_lo int, -- low temperature
temp_hi int, -- high temperature
prcp real, -- precipitation
date date
);
创建city表:
CREATE TABLE cities (
name varchar(80),
location point
);
创建临时的tmp表:
CREATE TABLE tmp (
tmp int
);
删除tmp表:
DROP TABLE tmp;
表创建好了,就要在其中插入数据了。见下一篇。
页:
[1]