-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtables.sql
37 lines (36 loc) · 839 Bytes
/
tables.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
34
35
36
37
CREATE TABLE Locations (
stop_id INT PRIMARY KEY,
latitude DECIMAL,
longitude DECIMAL,
state VARCHAR(3),
region VARCHAR(3),
town VARCHAR(100),
town_part VARCHAR(100),
stop_name VARCHAR(100)
);
CREATE TABLE WeatherData (
weather_id SERIAL PRIMARY KEY,
location_id INT REFERENCES Locations(stop_id),
weather JSONB,
main_temp DECIMAL,
main_feels_like DECIMAL,
main_temp_min DECIMAL,
main_temp_max DECIMAL,
main_pressure INT,
main_humidity INT,
main_sea_level INT,
main_grnd_level INT,
visibility INT,
wind_speed DECIMAL,
wind_deg INT,
wind_gust DECIMAL,
clouds_all INT,
rain_1h DECIMAL,
rain_3h DECIMAL,
snow_1h DECIMAL,
snow_3h DECIMAL,
dt TIMESTAMP,
sys_sunrise TIMESTAMP,
sys_sunset TIMESTAMP,
timezone INT
);