Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. USE [dbaebd839dbef34423b846a9ae01344d36]
  2. GO
  3.  
  4. /****** Object: Table [dbo].[Parks] Script Date: 14/12/2018 15:46:30 ******/
  5. SET ANSI_NULLS ON
  6. GO
  7.  
  8. SET QUOTED_IDENTIFIER ON
  9. GO
  10.  
  11. CREATE TABLE [dbo].[Parks](
  12. [Id] [nvarchar](50) NOT NULL,
  13. [Description] [nvarchar](150) NULL,
  14. [NumberOfSpots] [int] NOT NULL,
  15. [OperatingHours] [nvarchar](50) NULL,
  16. [NumberOfSpecialSpots] [int] NOT NULL,
  17. CONSTRAINT [PK_Parks] PRIMARY KEY CLUSTERED
  18. (
  19. [Id] ASC
  20. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  21. ) ON [PRIMARY]
  22. GO
  23.  
  24. CREATE TABLE [dbo].[Sensors](
  25. [Id] [int] IDENTITY(1,1) NOT NULL,
  26. [SensorId] [nvarchar](50) NOT NULL,
  27. [ParkId] [nvarchar](50) NOT NULL,
  28. [Type] [nvarchar](25) NULL,
  29. [LastUpdated] [datetime] NOT NULL,
  30. [SpotStatus] [bit] NOT NULL,
  31. [BatteryStatus] [bit] NOT NULL,
  32. [Location] [nvarchar](50) NOT NULL,
  33. CONSTRAINT [PK_Sensors] PRIMARY KEY CLUSTERED
  34. (
  35. [Id] ASC
  36. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  37. ) ON [PRIMARY]
  38. GO
  39.  
  40. ALTER TABLE [dbo].[Sensors] WITH CHECK ADD CONSTRAINT [FK_Sensors_Parks] FOREIGN KEY([ParkId])
  41. REFERENCES [dbo].[Parks] ([Id])
  42. GO
  43.  
  44. ALTER TABLE [dbo].[Sensors] CHECK CONSTRAINT [FK_Sensors_Parks]
  45. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement