且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SQL数据库结构

更新时间:2023-02-02 21:45:11

我会使用三个表:一个用于客户,一个用于问题一个用于答案。
I would use three tables: one for the clients, one for the questions, one for the answers.


我建​​议你将答案保存在详细信息表中,例如:

I suggest you to save the answers in a detail table, something like:
SEQU_ID		INTEGER			// Sequence independed on anything other
CUSTOMER_ID	(Up to you what you have)
FORM_ID		(Up to you what you have) // Check whether this is
                                          // allready in QUEST_ID below
QUEST_ID	(Up to you what you have)
ANSWER_IS	INTEGER			// {BOOL, DEC, VARCHAR}
ANSWER_BOOL	BOOLEAN
ANSWER_DECIMAL	DECIMAL
ANSWER_CHAR	NVARCHAR(20)		// "NVARCHAR" is Unicode compatible