Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions hows-the-weather/data/Tables/airquality.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE TABLE [data].[AirQuality](
[location_id] [int] NOT NULL,
[report_date] [date] NOT NULL,
[air_quality_index] [float](24) NOT NULL,
[dominant_pollutant] [varchar](10) NOT NULL,
[generated_on] [datetime] NOT NULL,

INDEX [ix_location_id] NONCLUSTERED ([location_id]),
CONSTRAINT [fk_aq_location_id] FOREIGN KEY ([location_id]) REFERENCES [data].[Location](location_id),

PRIMARY KEY CLUSTERED
(
[report_date] ASC,
[location_id] ASC
)
);
16 changes: 16 additions & 0 deletions hows-the-weather/data/Tables/location.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE TABLE [data].[Location](
[city_name] [varchar](255) NOT NULL,
[state_code] [varchar](2) NOT NULL,
[country_code] [varchar](2) NOT NULL,
[lat] [float](24) NOT NULL,
[lon] [float](24) NOT NULL,
[location_id] [int] IDENTITY(1,1) NOT NULL,

INDEX [ix_location_id] NONCLUSTERED ([location_id]),
CONSTRAINT [ix_location] UNIQUE ([city_name], [state_code], [country_code]),

PRIMARY KEY CLUSTERED
(
[location_id] ASC
)
);
22 changes: 22 additions & 0 deletions hows-the-weather/data/Tables/moon.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREATE TABLE [data].[Moon](
[report_date] [date] NOT NULL,
[moonrise_ts] [datetime] NULL,
[moonrise_az] [float](24) NULL,
[moonset_ts] [datetime] NULL,
[moonset_az] [float](24) NULL,
[high_moon_ts] [datetime] NULL,
[high_moon_dce] [float](24) NULL,
[moonphase_deg] [float](24) NOT NULL,
[moonphase_desc] [varchar](20) NOT NULL,
[location_id] [int] NOT NULL,
[generated_on] [datetime] NOT NULL,

INDEX [ix_location_id] NONCLUSTERED ([location_id]),
CONSTRAINT [fk__mn_location_id] FOREIGN KEY ([location_id]) REFERENCES [data].[Location](location_id),

PRIMARY KEY CLUSTERED
(
[report_date] ASC,
[location_id] ASC
)
);
18 changes: 18 additions & 0 deletions hows-the-weather/data/Tables/weather.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TABLE [data].[Weather]
(
[report_date] [date] NOT NULL,
[location_id] [int] NOT NULL,
[temperature] [float](24) NOT NULL,
[wind_speed] [float](24) NOT NULL,
[humidity] [float](24) NOT NULL,
[generated_on] [datetime] NOT NULL,

INDEX [ix_location_id] NONCLUSTERED ([location_id]),
CONSTRAINT [fk_wt_location_id] FOREIGN KEY ([location_id]) REFERENCES [data].[Location](location_id),

PRIMARY KEY CLUSTERED
(
[report_date] ASC,
[location_id] ASC
)
);
19 changes: 0 additions & 19 deletions hows-the-weather/data/airquality.sql

This file was deleted.

17 changes: 0 additions & 17 deletions hows-the-weather/data/moon.sql

This file was deleted.

21 changes: 0 additions & 21 deletions hows-the-weather/data/weather.sql

This file was deleted.