In this script we will leverage the capabilities of Amazon Bedrock's Generative AI service to author SQL statements. The Generative AI service provides advanced natural language processing to understand requirements and generate customized SQL code. This allows us to automate the creation of SQL queries for data analysis and reporting. The service is versatile and can be adapted for many different use cases across industries and domains. By integrating the Generative AI into our scripts, we enable intelligent SQL generation tailored to the specific data and insights we want to uncover. This simplifies and accelerates the process of gleaning actionable business intelligence from data.
Command1:
python3 Bedrock1.py WriteSQL "top ten customers by sales"
Output1:
SELECT Customer_Name FROM Customers ORDER BY Sales DESC LIMIT 10
Command2:
python3 Bedrock1.py WriteSQL "get the top ten customers by sales but print all fields from account object include costofliving"
Output2:
SELECT
customer__c,
last_name__c,
first_name__c,
sales__c,
cost_of_living__c
FROM
Account
ORDER BY
sales__c DESC
LIMIT
10;