VerbaGPT + AzureSQL

In this example we demonstrate using VerbaGPT together with AzureSQL. We use a sample AzureSQL database in this example.

Video:

User question: give me the top 10 courses in terms of the number of students enrolled in them. Also include the average grade for those courses.

VerbaGPT response:

Cost of query: $0.00 (Bing option)

VerbaGPT gives us the answer we are looking for. While this query might seem simple, it demonstrates the potential power of using large language models with relational databases, not just those in your local environment – but on the cloud as well!

Check out the full VerbaGPT read-out by click on below.

VerbaGPT Message Window
import pandas as pd

query = """
SELECT TOP 10 c.CourseId, c.Name, COUNT(DISTINCT cr.StudentId) as EnrolledStudents, AVG(cr.Grade) as AverageGrade
FROM Course c
JOIN Credit cr
ON c.CourseId = cr.CourseId
GROUP BY c.CourseId, c.Name
ORDER BY EnrolledStudents DESC
"""

df = pd.read_sql(query, conn)
df

For more examples, see the [Examples] menu at the top right.


Posted

in

, ,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *