≡ Menu

Using ChatGPT With A Database

You’ve no doubt heard about SQL (aka: Structure Query Language) – the language for working with databases. And by now you’ve likely heard of ChatGPT (aka: Chat Generative Pre-trained Transformer) which does a pretty good job of having a computer write text like a human.

Normally, when you want information from a database, you have to give it a command like this:

SELECT Cust_No, First_Name FROM Customers WHERE Last_Name='Smith';

To get a list of the first name and customer number of your customers with the last name of “Smith”, like so:

| Cust_No | First_Name |
| 1001    | John       |
| 2039    | David      |
| 2098    | Matthew    |
3 rows in set (0.05 sec)

You might ask, why can’t I just ask the computer, “Please give me the first names of all our customers who are named ‘Smith’?” and get that list? Well, now using ChatGPT, you can.

I have built a demo that does exactly that. Here it is:


Is it perfect? Definitely not. This is a demonstration of what’s possible today, and what we’ll be able to do in the near future. Give it a try!

Next post:

Previous post: