Skip to content
Snippets Groups Projects
1. CREATE TABLES.sql 813 B
Newer Older
USE [EnviromentalMonitoring]
GO

/****** Object:  Table [dbo].[Sensor]    Script Date: 19/10/2021 16:22:46 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Sensor](
	[sensorID] [int] IDENTITY(1,1) NOT NULL,
	[sensorUID] [nvarchar](50) NOT NULL,
	[locationLong] [decimal](11, 8) NOT NULL,
	[locationLat] [decimal](11, 8) NOT NULL,
	[locationCity] [decimal](11, 8) NOT NULL,
	[friendlyName] [nvarchar](50) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[SensorValue](
	[valueID] [int] IDENTITY(1,1) NOT NULL,
	[dateTime] [datetime] NOT NULL,
	[sensorID] [int] NOT NULL,
	[temperature] [decimal](14, 4) NULL,
	[humidity] [decimal](14, 4) NULL,
	[co2] [decimal](14, 4) NULL,
	[ppm25] [decimal](14, 4) NULL,
	[ppm10] [decimal](14, 4) NULL,
	[ppm100] [decimal](14, 4) NULL