/****** Table code in SQL ******/
/****** User table code ******/
USE [UserAccount] GO
/****** Object: Table [dbo].[User] Script Date: 26.06.2017 22:16:31 ******/ SET ANSI_NULLS ON GO
SET QUOTED_IDENTIFIER ON GO
CREATE TABLE [dbo].[User]( [ID] [int] IDENTITY(1,1) NOT NULL, [FirstName] nvarchar NOT NULL, [LastName] nvarchar NOT NULL, [Username] nvarchar NOT NULL, [Email] nvarchar NOT NULL, [Password] nvarchar NOT NULL, CONSTRAINT [PK_User_1] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]
GO
/****** Question table code ******/
USE [UserAccount] GO
/****** Object: Table [dbo].[Question] Script Date: 13.07.2017 14:06:38 ******/ SET ANSI_NULLS ON GO
SET QUOTED_IDENTIFIER ON GO
CREATE TABLE [dbo].[Question]( [ID] [int] IDENTITY(1,1) NOT NULL, [UserID] [int] NOT NULL, [Topic] nvarchar NULL, [Text] nvarchar NOT NULL, [Name] nvarchar NOT NULL, CONSTRAINT [PK_Question] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Question] WITH CHECK ADD CONSTRAINT [FK_Question_User] FOREIGN KEY([UserID]) REFERENCES [dbo].[User] ([ID]) GO
ALTER TABLE [dbo].[Question] CHECK CONSTRAINT [FK_Question_User] GO