-- =============================================                              

-- Author      : Shanu                            
-- Create date : 2015-08-13                              
-- Description : To Create Database,Table and Sample Insert Query                            
-- Latest                               
-- Modifier    : Shanu                               
-- Modify date : 2015-03-13                           

-- =============================================
--Script to create DB,Table and sample Insert data

USE MASTER
GO

-- 1) Check for the Database Exists .If the database is exist then drop and create new DB

IF EXISTS (SELECT [name] FROM sys.databases WHERE [name] = 'wordGameDB' )

DROP DATABASE wordGameDB

GO


CREATE DATABASE wordGameDB

GO


USE wordGameDB

GO


-- 1) //////////// ItemDetails table

-- Create Table ItemDetails,This table will be used to store the details like Item Information


IF EXISTS ( SELECT [name] FROM sys.tables WHERE [name] = 'wordDetails' )

DROP TABLE wordDetails

GO


CREATE TABLE wordDetails

(
   word_ID int identity(1,1),
   word_Name VARCHAR(100)  NOT NULL,
   image1 VARCHAR(100)  NOT NULL,
   image2 VARCHAR(100)  NOT NULL,
   image3 VARCHAR(100)  NOT NULL,
   image4 VARCHAR(100)  NOT NULL,
   Answer VARCHAR(100)  NOT NULL,
CONSTRAINT [PK_wordDetails] PRIMARY KEY CLUSTERED   
(   
  word_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

-- Insert the sample records to the ItemDetails Table

Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Animals','animals-01.png','animals-02.png','animals-03.png','animals-04.png','Animals')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Anouncement','Anouncement-01.png','Anouncement-02.png','Anouncement-03.png','Anouncement-04.png','Anouncement')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Colors','colors-01.png','colors-02.png','colors-03.png','colors-04.png','Colors')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Food','food-01.png','food-02.png','food-03.png','food-04.png','Food')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Green','Green-01.png','Green-02.png','Green-03.png','Green-04.png','Green')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Horror','horror-01.png','horror-02.png','horror-03.png','horror-04.png','Horror')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Java','Java-01.png','Java-02.png','Java-03.png','Java-04.png','Java')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Network','Network-01.png','Network-02.png','Network-03.png','Network-04.png','Network')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Night','night-01.png','night-02.png','night-03.png','night-04.png','Night')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Office','office-01.png','office-02.png','office-03.png','office-04.png','Office')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Play','play-01.png','play-02.png','play-03.png','play-04.png','Play')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Science','science-01.png','science-02.png','science-03.png','science-04.png','Science')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Space','space-01.png','space-02.png','space-03.png','space-04.png','Space')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Stone','stone-01.png','stone-02.png','stone-03.png','stone-04.png','Stone')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Tree','tree-01.png','tree-02.png','tree-03.png','tree-04.png','Tree')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Water','water-01.png','water-02.png','water-03.png','water-04.png','Water')
Insert into wordDetails(word_Name,image1,image2,image3,image4,Answer) values('Weather','Weather-01.png','Weather-02.png','Weather-03.png','Weather-04.png','Weather')

select * from wordDetails