Slide 1

Slide 1 text

AI Schema Enrichment Making NL2SQL feasible Jeff Smith Distinguished Product Manager Oracle Database Tools

Slide 2

Slide 2 text

Natural Language to SQL allows anyone to gain insight from their data and databases. Copyright © 2025, Oracle and/or its affiliates

Slide 3

Slide 3 text

Copyright © 2025, Oracle and/or its affiliates NL2SQL – from Questions to Queries Ask AI Based on user input: • Answer questions • Complete tasks • Reactive, user prompt dependent Example: write a SQL statement to get total sales Agentic AI AI agents work autonomously to: • Achieve complex goals • Proactive, goal-oriented action Example: resolve complex problem by accessing and analyzing customer data An AI-powered interface that translates plain language questions into executable SQL queries. INPUT "What were our top 10 customers last quarter?" OUTPUT SELECT customer_name, SUM(amount)...

Slide 4

Slide 4 text

Copyright © 2025, Oracle and/or its affiliates The Pipeline Ask AI Based on user input: • Answer questions • Complete tasks • Reactive, user prompt dependent Example: write a SQL statement to get total sales Agentic AI AI agents work autonomously to: • Achieve complex goals • Proactive, goal-oriented action Example: resolve complex problem by accessing and analyzing customer data Accept Question User submits natural language query 01 Discover Schema Explore via MCP 02 Generate SQL LLM translates intent to valid query. 03 Execute Run query, return results. Summarize. 04 Validation and self-correction loops occur between steps.

Slide 5

Slide 5 text

Problem: Your schema is a mess. Copyright © 2025, Oracle and/or its affiliates

Slide 6

Slide 6 text

Does this ring a bell? Coded names 'SALES' are stored in a table called XYZ123 Hardcoded relationships The application has keys, the database does not No documentation Unhelpful or missing comments Copyright © 2025, Oracle and/or its affiliates

Slide 7

Slide 7 text

How this impacts the business Copyright © 2025, Oracle and/or its affiliates 1. The LLM has a hard time finding what it needs to generate the correct SQL 2. Multiple queries are issued to the dictionary to find tables or views 3. Agent burns through tokens, Database burns CPU, user burns patience 4. The agent gives up, and comes back to the user for more information 5. Excessive prompt & context engineering required, for interactions with DB How many products did we sell last quarter?

Slide 8

Slide 8 text

Solution: AI Schema Enrichment Copyright © 2025, Oracle and/or its affiliates

Slide 9

Slide 9 text

Instead of stuffing your prompts with contexts and resources... Copyright © 2025, Oracle and/or its affiliates Annotate your schema, once!

Slide 10

Slide 10 text

AI Schema Enrichment – how it works Copyright © 2025, Oracle and/or its affiliates Oracle SQL Developer extension for VS Code offers a complete User Interface: • Local schema objects are created for managing/storing annotations • Works for ANY supported version of Oracle AI Database (19c, 21c, 26ai) • User inputs additional metadata for: o The schema o Optionally defined groups of tables by category or business purpose o One or more tables o One or more columns Oracle SQLcl's MCP Server has a schema-information tool • Shares w/agent combo of existing catalog metadata & user supplied annotations

Slide 11

Slide 11 text

Step 1: Connect with Oracle SQL Developer extension for VS Code Copyright © 2025, Oracle and/or its affiliates

Slide 12

Slide 12 text

Annotate the most frequently accessed areas Start with the schema itself! Copyright © 2025, Oracle and/or its affiliates Start with things like, what types of business operations does this schema support? What would help the AI Agent, to know overall about this area of the database?

Slide 13

Slide 13 text

Organize related objects using Table Groups Copyright © 2025, Oracle and/or its affiliates

Slide 14

Slide 14 text

Annotating tables Start with basic description of table and the important columns Copyright © 2025, Oracle and/or its affiliates

Slide 15

Slide 15 text

Suggestions and Best Practices Copyright © 2025, Oracle and/or its affiliates Your schema could have hundreds or thousands of objects • Target the high value objects, first • Consider including business logic that drives how the data is utilized • Agents frequently want to sample data from a table to see what it 'looks' like – you can include this as an annotation! • If tables are related, say so – esp if there are no foreign key constraints

Slide 16

Slide 16 text

Model Context Protocol (MCP) Overview

Slide 17

Slide 17 text

Model Context Protocol • Launched Nov 2024 by Anthropic • Marketed as “USB-C for AI applications” • Singular interface to standard interactions with database, files, business apps, developer tools… • Simplification hides the complexity of the Server implementation. An Introduction: modelcontextprotocol.io/introduction MCP Client Oracle DB MCP Server MCP Server MCP Server MCP Server MCP Server LLM

Slide 18

Slide 18 text

Model Context Protocol Server • Model Context Protocol Servers provide • Resources – Static items such as documents, images, files • Tools – Essentially a function call with input/output arguments • Prompts – Prompts to give to the LLM for use • Example MCP Servers: github.com/punkpeye/awesome-mcp-servers Resource Prompt Tool

Slide 19

Slide 19 text

Copyright © 2025, Oracle and/or its affiliates SQLcl: Release 25.4 Production on Tue Jan 22 10:35:35 2026 Copyright (c) 1982, 2025, Oracle. All rights reserved Connected to: Oracle Database 26ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free Version 23.26 SQL> cm list . ├── Cloud │ └── Autonomous Reporting └── Local ├── EMS └── ERP SQL> viins ¦ 1:0 ¦ OE¦ ERP Introducing Oracle Database’s MCP Server Database Availability • any edition, including FREE • any version (19c, 21c, 23ai, 26ai) • any deployment (on-premises, Cloud, containers, etc.) Technology stack • included with database • existing, proven product • runs locally, STDIO • JSON-RPC comms

Slide 20

Slide 20 text

Oracle SQLcl: MCP Server for Oracle Database • Provides to any MCP Client: • list-connections • connect • run-sql • run-sqlcl • schema-information • disconnect • Secure Access • Agent doesn’t work with database directly • Credentials never shared with the agent • Passwords/Certificates encrypted in Oracle wallets Copyright © 2025, Oracle and/or its affiliates

Slide 21

Slide 21 text

Agents can be told how to navigate your database! Copyright © 2025, Oracle and/or its affiliates • Our MCP Tool provides your Agent everything it needs to know about your application schema • Fewer queries to ‘figure stuff out’ • Faster, more efficient FEWER tokens!

Slide 22

Slide 22 text

Example: tell me about my online retail sales Copyright © 2025, Oracle and/or its affiliates • My table and column names are NOT descriptive • I have no table or column level comments • The data is stored as JSON • I have added AI Schema Enrichment data!

Slide 23

Slide 23 text

Our MCP Server delivers the enrichment data as CSV Copyright © 2025, Oracle and/or its affiliates

Slide 24

Slide 24 text

LLM immediately starts generating CORRECT SQL Copyright © 2025, Oracle and/or its affiliates

Slide 25

Slide 25 text

So what happened? Copyright © 2025, Oracle and/or its affiliates • Agent knew immediately to find the data in table, BAD_NAME_142 • Agent knew to query the column, C • Knew was stored as JSON, used JSON_TABLE constructor function • Knew the JSON array "products" and nested attribute labels, "product_name", "quantity" • One request for information in our schema • First attempt to generate SQL, success • Fewer Tokens consumed • Fewer Database and Network resources burned • AI Enrichment data added 1 time, now available in a consistent manner to every single AI Agent that supports MCP

Slide 26

Slide 26 text

Copyright © 2025, Oracle and/or its affiliates

Slide 27

Slide 27 text

SQLcl’s MCP Server is included with SQL Developer for VS Code

Slide 28

Slide 28 text

Next Steps Explore and learn more about our MCP Server. Explore the MCP LiveLab Download SQLcl Get started with our local MCP Server for the Oracle Database. Alternatively download our SQL Developer Extension for VS Code, which includes SQLcl. Copyright © 2025, Oracle and/or its affiliates Try FreeSQL.com Oracle’s free online portal for learning SQL and data management. Run in your browser or connect from your favorite development and query IDEs – perfect for exploring with your local agent via our MCP Server! Step-by-Step tutorials for getting started, including prompts to guide you on your Agentic AI development experience with the Oracle AI Database.

Slide 29

Slide 29 text

Copyright © 2025, Oracle and/or its affiliates Blog: Introducing Oracle MCP Server Docs: Oracle SQLcl MCP Server YouTube: General Overview Presentation YouTube: Demo, no slides! Additional Resources