You are on page 1of 1

SAP HANA •

SAP HANA SQL


To enable SQL commands in HANA DB: hdbsql -i 42 -u myuser -p
mypassword "select * from sys.users

Expressions
Case Expressions: IF,THEN,ELSE

C H E AT S H E E T • To display all schemas from the DB: Select * from schemas • Function Expressions: SQL built-in functions are used
• To display all tables: Select * from tables • Aggregate Expressions: COUNT,MIN,MAX,SUM,AVG,VAR.
• To display all users: Select * from sys.users
Architecture • To find out the log mode: SELECT value FROM
"SYS"."M_INIFILE_CONTENTS" WHERE KEY='log_mode'
It is an application that supports pure SQL for traditional apps as well as an • To create a table: create table table1(varchar(20)) Stored Procedure
interaction model specialized for the needs of SAP apps.
• Index server: Holds all the data tables and temporary results. • It is a piece of code that does a particular task.
• Pre-processor server: Is used in Text Analysis and extracts data from a Data Types • General Syntax:
text when the search function is used. CREATE PROCEDURE <proc_name> [(<parameter_clause>)]
• Name Server: This Server contains all information about the system Type Sub-Type SQL Column Store
[LANGUAGE <lang>]
landscape. In a distributed system it contains info about the running [SQL SECURITY <mode>] [DEFAULT SCHEMA
component and the location of its data. <default_schema_name>]
• Statistics Server: Responsible for data collection related to status,
date DATE CS_DAYDATE [READS SQL DATA [WITH RESULT VIEW
resource allocation and consumption of the system. <view_name>]] AS Admin View
• XS Server: Contains the XS engine. Enables the external apps to access the Date/Time time TIME CS_SECONDTIME {BEGIN
DB via XS Engine. [SEQUENTIAL EXECUTION] • System status: Internally tells the user that a transaction was done.
2nd date SECONDDATE CS_LONGDATE <procedure_body> • Available memory: Denotes how much of the total allocated memory is still available
END } to the user.
tinyint TINYINT CS_INT • CPU usage: It can display CPU usage for the past 24 hrs. It can display daily average
SAP HANA STUDIO Sequence & Trigger
CPU utilization for a single server and across systems for the past 30 days. This
information is an input for load balance analysis.
Small int SMALLINT CS_INT
• Activities:
• Sequence Creation: • Start/stop/backup/recovery instance
integer INT CS_INT CREATE SEQUENCE <sequence_name> • To monitor the system
Numeric [<sequence_parameter_list>] [RESET BY <subquery>] • Configure the engine instance
SAP HANA Database System Big int BIGINT CS_FIXED(18,0) • Trigger Creation: • Problem analysis
CREATE TRIGGER <trigger_name> <trigger_action_time>
decimal DECIMAL(p,s) CS_FIXED(p-s,s) <trigger_event_list>
XS ON <subject_table_name> [REFERENCING Catalog Node
Index Server Engine float FLOAT(n) CS_DOUBLE <transition_list>]
[<for_each_row>] • A database schema enables you to logically group together objects such as tables,
BEGIN views, and stored procedures. A catalog can not be written without first defining the
Boolean boolean BOOLEAN CS_INT schema.
[<trigger_decl_list>]
Statistics Name [<proc_handler_list>] • Physical Table: A SAP table consists of one or more fields each which is defined with
Preprocessor Variable <trigger_stmt_list> a data type and length. Typically a large amount of data is split up between various
Server Server NVARCHAR(n) CS_STRING
length END fields.
Character
Alpha-
ALPHANUM(n) CS_ALPHANUM
Components numeric HANA SLT Perspective
• SAP HANA DB: It is an in-memory, column-oriented, relational database
Binary • Enables you to load and replicate data in real time from a source and • They are a collection of screen elements that are designed specifically for a user such
Binary text VARBINARY(n) CS_RAW non source system into the HANA DB.
management system. Primarily used to store and retrieve data for Types that all screens required for his/her daily actions are stored such as modeler or
requesting apps. • It uses a trigger based replication to pass data to and fro int the admin.
• SAP HANA STUDIO: It is an eclipse based IDE that acts both as a system. • Content Folder: 3 types of views-
development tool and as the central admin tool.
Operators • Attribute Views: Provides a description of the characteristics of the data
• A database user with the same authorization as SYSTEM can initiate a stored. Considered as master data that defines the relationship and the
• SAP CLOUD APPLICATION: It is a PaaS system that provides environment
• Arithmetic Operators: Addition (+), Subtraction (-), Multiplication (*), connection to the SLT. hierarchy of data stored.
for development and runtime for cloud apps. It is open source hence
Division (/) • Analytic Views: They construct a central master fact table with key
allows ISV and startups to create and test HANA cloud apps.
• String Operator: Concatenation ( ||) figures. We use operators functions and expressions to analyze the said
• Comparison Operators: Equal to (=), Greater than(>), Lesser than(<), Less Admin Console data.
than or equal to (<=), Not equal (!=) • Calculation Views: Built on top of one or more analytic or attribute view.
SQL Functions • Logical Operators: Provides a way to do flexible, complex logic in the DB.
• AND - only if both conditions are true, will return true • System Admin Landscape: It is the layout of the servers and the
• Data type conversion function • OR- False if both Conditions are false. architecture of the server systems.
• Date functions • NOT- condition is true If Condition is false. • 3 Types:
• Full text functions: used for text search • SET Operators: • DEV- would have multiple clients like 190-Sandbox etc.
• Number functions: ABS, ROUND, POWER • UNION- Combines multiple select statements.
• String functions: ASCII, CHAR, CONCAT • UNION ALL- Includes duplicate rows while combining. • QAS- may have multiple clients like 300- integration test,
• Window functions : RANK(), DENSE_RANK(). • INTERSECT- Return common rows. 700-710 training FURTHERMORE:
• Others: CONVERT_CURRENCY, CURRENT_SCHEMA • EXCEPT- Removes row selected by the second query. • PRD- will have 200 production SAP HANA Certification Training

You might also like