Content
Your company runs on an ERP. SAP, Oracle, NetSuite, Microsoft Dynamics, or Odoo. It manages everything from finances to inventory to HR. But when you need a specific piece of data that's not in a standard report, you're stuck.
Each ERP has its own database, its own table naming conventions, and its own query quirks. Learning SQL is hard enough. Learning SQL for your specific ERP is harder.
Unless you let AI do the translation.
ERP Database Cheat Sheet
ERP System | Database | Table Prefix | Access Method |
|---|---|---|---|
SAP S/4HANA | SAP HANA | No standard prefix | HANA Studio, DBeaver |
SAP ECC | Various (Oracle, SQL Server, DB2) | No prefix | SE16, SQVI |
Oracle ERP Cloud | Oracle DB | Schema-based | OTBI, SQL Developer |
NetSuite | Oracle | No prefix | SuiteAnalytics, ODBC |
Dynamics 365 | SQL Server / Dataverse | dbo. | SSMS, Power Query |
Odoo | PostgreSQL | No prefix | pgAdmin, DBeaver |
SAP Queries
SAP's table names are cryptic but consistent. Once you know the key tables, queries become straightforward.
Key SAP Tables
Table | Description |
|---|---|
BKPF | Accounting document headers |
BSEG | Accounting document line items |
KNA1 | Customer master data |
LFA1 | Vendor master data |
MARA | Material master |
VBAK | Sales order headers |
VBAP | Sales order line items |
EKKO | Purchase order headers |
EKPO | Purchase order line items |
SAP: Open Sales Orders
Oracle ERP Cloud Queries
Oracle ERP Cloud uses Fusion-style table names that are more readable than SAP's.
Oracle: AP Invoice Summary
Oracle: GL Balance by Account
NetSuite Queries
NetSuite provides SuiteAnalytics Connect for direct SQL access via ODBC.
NetSuite: Customer Sales Summary
Microsoft Dynamics 365 Queries
Dynamics: Open Purchase Orders
Odoo Queries (PostgreSQL)
Odoo: Invoice Aging Report
The AI Advantage: One Tool for Every ERP
Each ERP has different table names, different SQL dialects, different conventions. Learning them all is impractical. AI2SQL handles the differences for you.
Just tell it:
Your ERP system (SAP, Oracle, NetSuite, etc.)
What data you need in plain English
Any filters or groupings you want
AI2SQL generates the correct SQL for your specific database. It knows that SAP uses VBAK for sales orders while Oracle uses oe_order_headers_all. It knows NetSuite uses SuiteQL syntax while Odoo runs on PostgreSQL.
Examples
"Show me overdue AP invoices in SAP" → query with BKPF/BSEG tables
"Top 10 customers by revenue in NetSuite" → query with transaction/transactionLine
"Open purchase orders in Dynamics 365" → query with PurchTable/PurchLine
"Invoice aging report in Odoo" → query with account_move/res_partner
Get Started
Your ERP database holds the answers to every business question. You just need to know how to ask. AI2SQL translates your questions into the right SQL for your system.
Try it free at ai2sql.io. No SQL knowledge required. No ERP expertise needed.


