create table cities (
city varchar(80) primary key,
location point
);
create table weather (
city varchar(80) references cities(city),
temp_lo int,
temp_hi int,
prcp real,
date date
);
这篇博客介绍了如何创建两个数据库表,一个用于存储城市信息,包含城市名和地理位置;另一个用于存储天气数据,包括城市外键、最低温度、最高温度、降雨量和日期。这是构建气象信息系统的基础步骤。
create table cities (
city varchar(80) primary key,
location point
);
create table weather (
city varchar(80) references cities(city),
temp_lo int,
temp_hi int,
prcp real,
date date
);

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