Good start but a bit rough when actually using it, both in terms of UX and output. My first prompt, "Explain this query", resulted in a 500 internal server error. I figured out I had to include the query with the prompt but in these cases, Studio should really pick up the SQL in the active SQL pane.
Second, the AI model seems to be poor at holding onto context. Example:
>Explain this query: SELECT * FROM OTC_OPEN_CALLS_AUTO ooca WHERE ooca.dsp_diag_code like '17%'
Explanation (which was fine)
>Produce a count of calls per month
To produce a count of calls per month, I need to know the name of the table that contains the call data and the column that stores the call date. Given the context of your previous queries, I will assume that the relevant table could be OTC_OPEN_CALLS_AUTO and that it has a date column such as call_date or similar. Please confirm the exact table and date column names, or I can proceed with a general example assuming common column names such as call_date. Would you like me to generate a SQL query based on OTC_OPEN_CALLS_AUTO with a call_date column, or provide details after verifying the correct column?
Given that the model has access to the schema, I would expect to response to offer possible candidates, not a made up column.
>use file_timestamp
Thank you for the clarification. I will generate a SQL query to count the number of calls per month using the file_timestamp column from the OTC_OPEN_CALLS_AUTO table. Here's the SQL query:
SELECT
YEAR(file_timestamp) AS CallYear,
MONTH(file_timestamp) AS CallMonth,
COUNT(*) AS CallCount
FROM
OTC_OPEN_CALLS_AUTO
GROUP BY
YEAR(file_timestamp),
MONTH(file_timestamp)
ORDER BY
CallYear,
CallMonth;
The query had lost both the WHERE clause and table alias