You are on page 1of 3

USE tempdb; GO CREATE TABLE [User] ( UserID INT IDENTITY ( 1 , 1 ) PRIMARY KEY, LastName VARCHAR(30), FirstName VARCHAR(20), Phone

VARCHAR(20), Mobile VARCHAR(20), Email VARCHAR(70), Gender CHAR(1), ModifiedDate SMALLDATETIME DEFAULT (Getdate())) GO CREATE TABLE TextBook ( TextBookID INT IDENTITY ( 1 , 1 ) PRIMARY KEY, Title VARCHAR(80), Publisher VARCHAR(50), ModifiedDate SMALLDATETIME DEFAULT (Getdate())) GO CREATE TABLE [Content] ( ContentID INT IDENTITY ( 1 , 1 ) PRIMARY KEY, TextBookID INT references TextBook(TextBookID), ChapterID TINYINT, Title VARCHAR(80), [Content] TEXT, ModifiedDate SMALLDATETIME DEFAULT (Getdate())) GO CREATE TABLE Question ( QuestionID INT IDENTITY ( 1 , 1 ) PRIMARY KEY, ContentID INT references [Content](ContentID), Question VARCHAR(256), ModifiedDate SMALLDATETIME DEFAULT (Getdate())) GO

CREATE TABLE Answer ( AnswerID INT IDENTITY ( 1 , 1 ) PRIMARY KEY, QuestionID INT references [Question](QuestionID), SEQUENCE TINYINT, Answer VARCHAR(96), GoodAnswer BIT, ModifiedDate SMALLDATETIME DEFAULT (Getdate())) GO CREATE TABLE Exam ( ExamID INT IDENTITY ( 1 , 1 ) PRIMARY KEY, TextBookID INT references [TextBook](TextBookID), UserID INT references [User](UserID), QuestionID INT references [Question](QuestionID), AnswerID INT references [Answer](AnswerID), ModifiedDate SMALLDATETIME DEFAULT (Getdate())) GO -- Cleanup /* DROP TABLE Exam DROP TABLE [User] DROP TABLE Answer DROP TABLE Question DROP TABLE [Content] DROP TABLE Textbook

1) user table user_id (pk) user name password email_id address phno 1 ram ram b@b.in hyd 111 2) Exam papers master table exam_id (pk) exam paper name hours 1 asp.net 2.0

00:30

3) Questions for each examination master table Question_id(pk) exam_id(fk) question 1 1 What is view state? 4) Given Answers of questions of each exam opt_id(pk) opt1 opt2 opt3 opt4 answer question_id (fk) 1 a) b) c) d) b 1 exam_id(fk) 1 5) answers given by each user table answer_id(pk) user_id(fk) question_id(fk) 1 1 1 exam_id (fk) opt_id (fk) answer given 1 1 b status date start time NNew 11/05/2010 11:05 am > fixed time(exam started time) AAnswered >One special login page is used by admin, he will selects the paper and says to start examination ie exam_id and start time (server time) will be saved in application memory. Ie

6) exam starting table start_id(pk) exam_id (fk) starting time 1 1 11:05am

You might also like