IT CanvassTalk to an advisor
SAP HANA · LessonBy , SAP Trainer, 10 yrs · Published · SAP S/4HANA 2023 · all levels

SQL

SQL is the primary language for querying and manipulating data in HANA, and SQLScript extends it for database-side procedural logic. Strong SQL skills let you exploit HANA’s speed through the code-to-data paradigm.

Quick answer

ABAP developers mostly use Open SQL and CDS (which generate HANA SQL), but understanding native HANA SQL/SQLScript helps you write efficient CDS, optimise, and work directly with HANA when needed.

Key takeaways
  • HANA supports standard SQL for the usual SELECT/INSERT/UPDATE/DELETE plus rich analytical features (window functions, aggregations…
  • SQLScript adds procedural constructs (variables, control flow, table variables) so you can implement more complex logic as stored…
  • The guiding principle on HANA is code-to-data: bring the computation to where the data lives (the database) rather than moving…
  • Watch out: Row-by-row processing instead of set-based SQL.

HANA SQL

HANA supports standard SQL for the usual SELECT/INSERT/UPDATE/DELETE plus rich analytical features (window functions, aggregations, joins). Because HANA is columnar and in-memory, set-based SQL that aggregates and filters in the database is extremely fast, far better than pulling rows out and looping.

SQLScript for logic

SQLScript adds procedural constructs (variables, control flow, table variables) so you can implement more complex logic as stored procedures and functions that run inside HANA. This is central to code pushdown: move data-intensive logic to the database instead of the application server.

Code-to-data

The guiding principle on HANA is code-to-data: bring the computation to where the data lives (the database) rather than moving large data sets to the application. Well-written SQL/SQLScript and CDS embody this, delivering big performance gains over row-by-row ABAP.

In the SAP context

ABAP developers mostly use Open SQL and CDS (which generate HANA SQL), but understanding native HANA SQL/SQLScript helps you write efficient CDS, optimise, and work directly with HANA when needed.

Common pitfalls

  • Row-by-row processing instead of set-based SQL.
  • Pulling data out rather than pushing logic down.
  • Ignoring window/aggregate functions HANA does well.

Practice challenge

+0 XPStreak ×0
Question 1 of 3
Which statement is true of SQL?

Frequently asked questions

What does SQL stand for in SAP?
SQL is the primary language for querying and manipulating data in HANA, and SQLScript extends it for database-side procedural logic. Strong SQL skills let you exploit HANA’s speed through the code-to-data paradigm.
What is another point to note about SQL?
ABAP developers mostly use Open SQL and CDS (which generate HANA SQL), but understanding native HANA SQL/SQLScript helps you write efficient CDS, optimise, and work directly with HANA when needed.
What else is worth knowing about SQL?
HANA supports standard SQL for the usual SELECT/INSERT/UPDATE/DELETE plus rich analytical features (window functions, aggregations, joins).
What tends to go wrong with SQL?
Row-by-row processing instead of set-based SQL. Pulling data out rather than pushing logic down. Ignoring window/aggregate functions HANA does well.
Already working on SAP and stuck on a live ticket?Get an expert SAP developer on screen-share to finish your daily tasks with you. Deliver on time, protect your reputation and your job. Monthly support only, no task-wise plans.Task assigned · no idea where to startStill stuck · your job on the lineExpert joins your screenDelivered on timeExplore On Job Support