本文介绍了测验应用程序的数据库设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为测验设计数据库,而且我被卡住了。我不知道该怎么办。



以下是相关信息:



玩家答案10问题。



每个问题有3个答案。只有一个答案是正确的,其他2个是错误的。



我需要数据库设计方面的帮助。



我尝试过:



这是我的设计:



玩家



ID bigint(主键,身份)

名称nvarchar( MAX)



问题



ID bigint(主键,身份)

TextOfTheQuestion nvarchar(MAX)



答案



ID bigint(主键,身份)

TextOfTheAnswer nvarchar(MAX)

QuestionID bigint (Questions.ID的外键)

isCorrectAnswer位



PlayerChoices



PlayerID bigint(主键,Players.ID的外键)

AnswerID bigint(主键,Answers.ID的外键)

I am designing database for a quiz, and I am stuck. I do not know how to do it.

Here is the relevant information:

Player answers 10 questions.

Each question has 3 answers. Only one answer is correct, other 2 are wrong.

I need help with database design.

What I have tried:

Here is my design:

Table Players:

ID bigint (primary key, identity)
Name nvarchar(MAX)

Table Questions:

ID bigint (primary key, identity)
TextOfTheQuestion nvarchar(MAX)

Table Answers:

ID bigint (primary key, identity)
TextOfTheAnswer nvarchar(MAX)
QuestionID bigint (foreign key to Questions.ID)
isCorrectAnswer bit

Table PlayerChoices:

PlayerID bigint (primary key, foreign key to Players.ID)
AnswerID bigint (primary key, foreign key to Answers.ID)

推荐答案


这篇关于测验应用程序的数据库设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 19:59