1,创建新表 weather
CREATE TABLE weather (
city varchar(80),
temp_lo int, -- low temperature
temp_hi int, -- high temperature
prcp real, -- precipitation
date date
);
mydb=# \d
Did not find any relations.
mydb=# CREATE TABLE weather (
mydb(# city varchar(80),
mydb(# temp_lo int, -- low temperature
mydb(# temp_hi int, -- high temperature
mydb(# prcp real, -- precipitation
mydb(# date date
mydb(# );
CREATE TABLE
mydb=# \d
List of relations
这篇博客详细介绍了如何在PostgreSQL中创建表,包括数据类型如varchar、int、real和date,以及如何向表中插入数据。还提到了自定义数据类型和使用COPY命令批量导入数据的方法。
订阅专栏 解锁全文
2480

被折叠的 条评论
为什么被折叠?



