Skip to main content

Talking to Oracle Database, this time in plain Slovenian

Talking to Oracle Database in Slovenina

Talking to Oracle Database in Slovenian

In my previous blog post, Talking to Oracle Database in plain English I am discussing how to query Oracle Database using natural language queries to retrieve data from an Oracle database.

Exploring SELECT AI

Select AI
Figure 1: Select AI

From my quick exploration, I can conclude that AI has definitely entered databases and can be applied in very different scenarios. For example, using SELECT AI in chat application where data can be retrieved and presented from Oracle Database by applying natural language query. But that was in plain English.

But what about if my primary natural language isn't English. What if your (and, for this matter also mine) isn't English. What if it is Slovenian? Would SELECT AI still work?

Revisiting English Examples in Slovenian

Let's examine the very same examples that I used in my previous blog post.

Let's talk now ... po slovensko

Enough said. Let's try the simplest query of all and let's ask my database what is the total revenue recorded. In Slovenian the question, what is total revenue translates into:

select ai kakšni so skupni pridodki

And the response is?

Simple SELECT Ai Query
Figure 2: Simple SELECT AI query in Slovenian

The response we've got is correct. Interesting, so far so good!

Just out of curiosity, what would be the response if I used narrate option in select ai?

select ai narrate kakšni so skupni pridodki

Well, database replies in Slovenian. Of course, what else ...

Simple SELECT Ai Query with NARRATE
Figure 3: Simple SELECT AI query with NARRATE option in Slovenian

Segment Analysis in Slovenian

In my next query I have asked database what is the revenue by customer segments in the last year. In Slovenian, the question is as follows:

select ai kakšen je prihodek po segmentih kupcev v zadnjem letu

And, I am getting used to it by now already, the question was understood and response given was the same as if I asked in plain English.

A bit more complex SELECT AI query
Figure 4: A bit more complex SELECT AI query in Slovenian

With showsql option, we can examine SQL that was generated:

A bit more complex SELECT AI query using showsql
Figure 5: SQL generated by SELECT AI with showsql option

SQL is correct:

Running SQL generated by SELECT AI
Figure 6: Running SQL generated by SELECT AI

Or for potentially documeting purposes, we could ask database to explain that same SQL:

Explain SQL generated by SELECT AI
Figure 7: Explanation of SQL generated by SELECT AI

This response as such obviously is generated by ChatGPT and has nothing to do with underlying database. Nevertheless, could be very useful in some cases.

Challenging SELECT AI Further

In the next couple of examples I tried to challenge Oracle Database in Slovenian a bit further asking questions that would include more data, more tables.

The first query is adding additional measures, and the question in english is "what are total revenues and units sold in the last year*. In Slovenian, this is as follows:

select ai prikaži letne prihodke in prodane količine po segmentih kupcev v zadnjem letu

And the response is again correct:

Adding measures in the query
Figure 8: Adding measures in the query

Ok, let's drill down previous by months of the last year (note: last year in my dataset is 2022):

select ai prikaži skupne prihodke in prodane količine po letih, mesecih in segmentih kupcev v zadnjem letu
Drill down to get more details by months
Figure 9: Drill down to get more details by months

Here are some additional examples how to run efficient queries against Oracle database in Slovenian language. For comparison, I am adding, side by side, same questions in English:

Top 5 products by revenue
Figure 10: Top 5 products by revenue
Comparing and calculating
Figure 11: Comparing and calculating
Customers by segments
Figure 12: Customers by segments
Total costs by brand
Figure 13: Total costs by brand

Testing with Complex Multilingual Queries

I saved this one for the end. Quite a bit complex question in English display revenue, total costs, profit, profit margin, fixed cost share in total costs, variable costs share in total costs by product brand, customer segments and regions for this year would sound in Slovenian something like this:

prikaži prihodke, skupne stroške,profit in profitne stopnje,
delež fiksnih stroškov v skupnih stroških, delež variabilnih stroškov v skupnih stroških,
po blagovni znamki, segmentih kupcev in regijah za letos

The result of the query is absolutely correct.

Really complex one
Figure 14: Really complex SELECT AI query in Slovenian

The table from above can be simply converted into something more visual, scatter graph for example:

Really complex one as scatter graph
Figure 15: Really complex query visualized as scatter graph

Let me get back to the main question: Can Oracle database talk to its users in Slovenian? The answer is yes. Absolutely. However, users have to careful. Responses that I am providing above were not always generated as expected. It required a bit of question-fine-tuning to get what I wanted, and I must confess there are still some examples that I am not able to persuade database to get back with the correct answers. Maybe something got lost in translation. I don't know to be honest.

  • SELECT AI successfully interprets Slovenian input for simple and complex queries.
  • Translation accuracy impacts output—some questions needed refinement.
  • Cross-lingual capabilities are promising, but not yet perfect.

The next question that pops up to my mind is what about other languages? Well situation is pretty similar as with Slovenian.

For example, Serbia is not that far from Slovenia. In Serbia, they use cyrillic letters, therefore it is quite interesting to see how Oracle database would react to that?

Really complex one in Serbian Cyrillic
Figure 16: Really complex query in Serbian Cyrillic

Well it works! What if I move a few hundred miles south to Greece? Translation looks very Greek to me - not having the slightest idea what the question is about.

Really complex one in Greek
Figure 17: Really complex query in Greek

Ok. In this case the answer is not 100% same as the ones above. But I assume in this case, something was indeed lost in translation. But well, it's returning valid values, so probably native speaking Greek could do some fine tuning on the question and response would be correct as expected.

We could go on, asking question in various language and writings, but most of them would return back correct response. Just like the question in traditional Chinese:

Really complex one in Chinese
Figure 18: Really complex query in traditional Chinese

Conclusion

This was my second encounter with LLM and their integration with Oracle database. And my impression is even more positive than a week ago. I found database that can actually speak Slovenian.


I began my previous blog post with my beginnings with SQL. Now, database can speak my own natural language. So, how cool is that?