-
Notifications
You must be signed in to change notification settings - Fork 0
/
dump.sql
33 lines (30 loc) · 805 Bytes
/
dump.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
CREATE TABLE city (
id serial,
city_name varchar(255),
latitude double precision,
longitude double precision,
start_date date,
end_date date,
PRIMARY KEY(id)
);
CREATE TABLE weather_data (
id serial,
city_id int,
time timestamp,
temperature double precision,
precipitation double precision,
PRIMARY KEY(id),
CONSTRAINT city_fk FOREIGN KEY (city_id)
REFERENCES City(id)
);
CREATE TABLE season (
id serial,
city_id int,
year int,
mean_precipitation double precision,
season_name varchar(50),
PRIMARY KEY(id),
CONSTRAINT city_fk FOREIGN KEY (city_id)
REFERENCES City(id)
);
INSERT INTO city(city_name, latitude, longitude, start_date, end_date) VALUES ('Rome', 41.9027, 12.4963, '2012-01-01', '2022-12-31');