Question: 4 Personal Assistants are programmes which respond to user utterances (spoken or typed commands). For example, they can be used to provide helpful answers to

4 Personal Assistants are programmes which respond to user utterances (spoken or typed commands). For example, they can be used to provide helpful answers to a users question about products on a website. A simple Personal Assistant works by (approximately) matching a users query about a product to a previously known question about that product and then choose the appropriate answer or response for that known question. If the simple Personal Assistant cannot match the users query to a known question & product, it just returns a default error message Sorry I dont understand, can you rephrase your question?). Suppose a Simple-PersonalAssistant contains a database to store known questions about products available on a retail website and a set of appropriate responses for such known questions. The Simple-PersonalAssistant works by taking each users utterance (question) and matching it to the most similar known question stored in the database. You may assume the Simple-PersonalAssistant uses an internal algorithm to match the user question about a particular product to the most similar known question. It then looks up which response is appropriate for that known product related question and retrieves that response. Thus, the Simple-PersonalAssistant database stores a list of known questions about the website products, the product(s) to which each known question relates and the IDs of the response appropriate for that known question. For each product the database stores the product ID, its description and its current retail price. The database also stores each predefined Simple-PersonalAssistants response (as text) and a unique ResponseID to identify each response. For logging purposes, the database also stores the original text of a users question (utterance), the user ID of the person who asked the question, the time & date of which the question was asked and a log of the ResponseID which the SimplePersonalAssistant gave for the question (utterance). As it cannot be assumed that every user question is unique, the Simple-PersonalAssistant also generates a unique utterance ID for each question asked by a user.

(iii) Write SQL commands to perform the following:

(a). List all of the KnownQuestions and their ResponseTexts for the ProductID 10090. [5 Marks]

(b).Give the SQL commands to store a new Response where the ResponseID is 555 and the ResponseText is This product can only be sold to a person over 18 years of age. Suppose this response is the appropriate response for KnownQuestionIDs 77 & 78, about the Product with ProductId 10010. Give the SQL commands needed to relate the response to these KnownQuestionIDs and ProductID. You may assume that the Product information for ProductId 10010, and related KnownQuestionTexts for KnowQuestionIDs 77 & 78 already exists in the database but had not yet been assigned a ResponseID [5 Marks]

(c). Give the SQL command to define the table which contains User Question, Utterance ID, the User Id, the Time and Date of the question and the log of ResponseID given by personalAssistant for the question. In your answer indicate how you would ensure that the UtteranceID would be automatically created and always unique. [3 Marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!