0

这有点像基于知识的系统。例如:

当用户转到第一页时,我们称其为“我该如何帮助您?” 将有 4 个选项:

  1. 发生火灾时
  2. 受伤
  3. 有一场战斗
  4. 服从

如果用户选择了1 "In case of fire",它会问他们一些其他问题:

  1. 可以用灭火器吗?
  2. 有人受伤吗?

如果用户选择了2 "There is a fight",它会问他们类似的问题:

  1. 有人受伤吗?
  2. 周围的保安?

基本上,如果用户选择1“万一发生火灾”2“发生战斗”,则程序中至少会有一个共同问题。

终点是一篇帮助文章。例如,如果用户选择“有人受伤了吗?”,这将是用户看到帮助文档的终点。

我如何为此设计数据库?

4

1 回答 1

0

This is a variation of the Bill Of Materials database.

One way to design this would be the following table:

Question
--------
Question ID
Previous Question ID
Question Text
Help Article URL

The Question ID is an auto-incrementing integer, and is the primary or clustering key for the table. The Previous Question ID is null for your top level questions, and a pointer back to the Question ID for lower level questions. The Help Article URL is null or points to a help article.

The question numbers are supplied by the application as it reads rows from the Question table.

于 2015-02-25T17:24:20.483 回答