Mysql – Representing call center customer question logic

arrays, data-structures, mysql

I need to solve a problem within job booking software and am hoping to find a good way of doing that.

The current system uses a set of check boxes to represent the problem description when a customer rings up. These check boxes are useful to admin, but not really from a customer perspective.

My thoughts were to have 1 or more english representations of these checkbox items, corresponding to each one. That would be easily searchable on the fly while a customer was on the phone explaining their problem.

Sometimes the telephone operator may need to ask a further question though, and I will need to allow for a level of questioning after the initial problem description.

At the end of the problem diagnosis, this should still represent 1 or more checkboxes at the back end.

An example:

  • A customer rings up complaining that "my water is cold".
  • Telephone operator types in "cold" and multiple results are returned "repair hot water system – gas" & "repair hot water system – electric"
  • In order to correctly choose, another set of questions is presented for the telephone operator to ask. "Is your HWS Gas?", "Is your HWS Electric?"

Once that is selected, the correct item is associated with the job.

I need to find the best way to represent this?

I guess the core elements are:

  1. The low level checkbox descriptions
  2. The english descriptions (1 or more per checkbox)
  3. The secondary questions to narrow down the description

Any help would be appreciated!

Best Solution

Basically, one question can have multiple answers. Each answer can lead to multiple questions. This can go on for multiple levels. Here is a very basic description of how I would approach tackling this...

Here is a suggested lookup table structure:

table: Questions (QId, QuestionText) all questions are saved here
table: Answers (AId, AnswerValue) all possible answers are here (yes, no, cold, hot, warm, not working, etc)
table: QuestionAnswers (QAId, QId, AId) question answer combinations are stored here (is the ac working? yes / no)
table: RelatedQuestions (QAId, QId) for a given question answer combination, what is the next set of question(s) to ask ("is the ac working - no" then ask "do you have power?, do you have an AC in the house", "is this the car a/c or the home AC?")

Here is a suggested data table structure:

table: CustomerInfo (CuId, CDetails...) one record per customer
table: ContactInfo (CId, Cdetails...) one record each time a customer is contacted
table: QASeriesForContact (QACId, CId, SearchTerm) the search term / issue (you can have multiple of these per call, right?)
table: QASeriesDetails (QASDId, QACId, QAId) for each problem, track the question answers until resolution

I know we are going to have to modify this a fair bit to suit your needs - fire away and I will do my best to help.