SAP HANA SQLScript

Clean SQLScript Code

18 flashcards · answers and spaced-repetition review in the KnowCard app

Using the team's Hungarian notation, decode what IV_MAX_ROWS and LT_MATERIAL each are.
Following Knuth, when should you tune a SQLScript query for performance, and why not sooner?
The chapter lists four primary code requirements: correctness, maintainability, performance, and production efficiency. Which quality does the author call the prerequisite for reaching all of them?
You press the format button in SAP HANA Web-Based Development Workbench on a stored procedure. What actually happens?
In one code base the MARA material is called MATNR in one place, MATERIAL in another, and MAT elsewhere. Why is that a readability defect even though each name is valid on its own?
In the SQLScript Hungarian-notation convention, the first letter of a variable name encodes its kind. Which kind-prefix is SQLScript-only, and which ones are ABAP-only?
Robert C. Martin's Clean Code says a method should be ~20 lines, not 100. Why can't that rule be applied wholesale to SQLScript?
You move a complex CASE/COALESCE expression out of a SELECT field list into a user-defined function. Beyond shorter code, what capability do you gain that you did NOT have while it was inline?
Why does the author treat heavy commenting as a net negative, calling 'a lot helps a lot' a misconception?
You see a comment that splits a procedure into labelled sections. Under this chapter's comment taxonomy, what does that structure comment usually signal, and which comment type is genuinely legitimate?
Name the five canonical steps for decomposing a complex SELECT into table variables, in order.
In the join step of a decomposed query you may write SELECT with asterisks (tasks.*, projects.*). What earlier step makes those wildcards safe, and what would break without it?
You split a monolithic SELECT into five readable table-variable steps. What does that refactoring cost at runtime in SAP HANA?
Restrict data as early as possible. Query runtime grows with the number of rows — what SECOND dimension does the chapter stress that developers routinely forget?
A single query reads some data from the row store and some from the column store. What hidden cost does that mixing introduce, and how do you spot it in the execution plan?
To speed up a slow scalar user-defined function, a colleague adds the DETERMINISTIC keyword and a small SELECT ... FROM DUMMY inside it. What's wrong with both moves?
Both of these run and return rows. How do their results differ? ``` SELECT * FROM colors sizes; SELECT * FROM colors, sizes; ```
With the session set to ABAPVARCHARMODE = 'TRUE', what does this return? ``` SELECT 'Peter'||' '||'Mueller' FROM DUMMY; ```

Start learning today

Free to start — download the app or use it in your browser.

Get it on App StoreGet it on Google Play
Clean SQLScript Code (SAP HANA SQLScript) · KnowCard