Prompt Engineering ChatGPT Requests for Data Professional Use

Knowing how to create a good prompt for a language model AI technology is a skill that can result in more complete and pointed results.

Prompt Engineering ChapGPT

ChatGPT can provide actionable and detailed data task instructions in support of the efforts of data administrators, data engineers, data analysts, and other data wranglers looking to evaluate possibilities within their data environments. Knowing how to ask questions is a skill that contributes significantly by providing more complete and pointed results.

In this blog, I’ll provide some ideas on how an enterprise can effectively employ language model AI technology to enrich themselves with examples of how data management tasks are performed with or without the insight of a seasoned database professional.

  • What is it? In a self-described definition, “ChatGPT is a language model developed by OpenAI, based on the GPT-3.5 architecture, that uses deep learning techniques to generate natural language text.”
  • What does ChatGPT stand for? Chat Generative Pre-Trained Transformer
Prompt Engineering

In his DEV blog Sasmitha Manathunga introduces us to Prompt Engineering, “the quality of the responses,” and the “art of engineering the perfect prompt.” As defined by Manathunga, Prompt Engineering is, “the process of creating prompts that will produce the optimal results for our task.” As ChatGPT and natural language text becomes more prevalent, prompt engineering will become an essential skill. 

The following are a few recommendations from Manathunga and similar bloggers to help prompt engineer your ChatGPT request:

  • Have a clear goal in mind. What do you want to achieve? Be specific in your request.
  • Use conditional statements to prompt the AI bot to check for keywords or phrases in the user’s request. Use if-then statements to filter results.
  • Provide context by supplying relevant background information to help the AI bot provide better responses. Give examples, insert a URL as an example.
  • Prompt the Model to explain its reasoning. The cues to explain ‘step-by-step’ or ‘give detailed steps’ within the request prompt can increase accuracy and consistency.
  • Make adjustments to your prompt and test again until you achieve your desired result.
ChatGPT in Support of a Data Environment

Below are some examples of how one might craft their ChatGPT query to leverage prompt engineering to return detailed, application-specific responses to support various data environment tasks. The following replies are descriptive tasks, not specific step-by-step instructions, and they do not apply to every computing environment. However, the replies are complete enough to provide a well-defined, high-level description of the task at hand and enable administrators to compare it with the test processes at hand. As such, evaluating the AI response still requires the expert analysis of the data professional, but it does, in fact, produce an initial form of that task that can be shaped into a more actionable plan.  

“…Evaluating the AI response still requires the expert analysis of the data professional, but it does, in fact, produce an initial form of that task that can be shaped into a more actionable plan.”

Example Prompts Followed by ChatGPT Responses
  1. Write a SQL DBA query that returns all permissions and accesses for all users and all roles to all databases on a SQL Server.
ChatGPT Prompt Example 1

2. Write a SQL Server audit query to produce who has queried a certain database over the past 30 days; include all users, applications and source locations.

ChatGPT Prompt Example 2

3. Use a SQL DBA database performance query to return index health of a SQL Server database, include statistics and disk usage.

ChatGPT Prompt Example 3
ChatGPT Prompt Example 3a

4. Write a SQL Server DBA performance tuning query to provide a query execution plan.

ChatGPT Prompt Example 4

5. What are the detailed steps to create an SSIS package which imports an EXCEL spreadsheet to a SQL server database table?

ChatGPT Prompt Example 5

6. Architect a dimensional data model to compare Walmart sales data before and after COVID.

ChatGPT Prompt Example 6

7. What are the detailed steps required to create an SSIS package to import a large EPIC healthcare Oracle database to a SQL Server Data Warehouse?

ChatGPT Prompt Example 7

8. Write the detailed steps to create an SSIS package to incrementally import changed health record data while archiving the changed data results and preserving access to protected Personally Identifiable Information (PII).

ChatGPT Prompt Example 8

9. What are the specific, detailed steps a Data Engineer would use to develop an Azure Data Factory Rest API to import sales data from Amazon and transform the sales table to a dimensional data model?

ChatGPT Prompt Example 9

10. Provide the detailed steps a SQL Server DBA would use to migrate a SQL Server database to a remote server to include scripted logins, permissions, schemas and all other database objects.

ChatGPT Prompt Example 10

In summary, natural language text generators such as ChatGPT are being evaluated throughout the IT industry as an AI bridge between an inexpert technician and a seasoned IT professional. The quality of the de facto AI responses can vary widely depending on the skill of the requestor and the application of Prompt Engineering. If you are wanting to dive deeper into how language model AI technology can help your business, reach out to our Data Strategy Group today!

Sources


Written By:

Joe Dunn Keller Schroeder

Joe Dunn
Senior Data Engineer
Data Strategy Group

Share:

Join Our Mailing List

More Posts