

{"id":55830,"date":"2019-05-06T12:59:58","date_gmt":"2019-05-06T07:29:58","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=55830"},"modified":"2021-12-04T13:12:44","modified_gmt":"2021-12-04T07:42:44","slug":"sap-hana-sql","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/","title":{"rendered":"SAP HANA SQL &#8211; An Ultimate Cheat Sheet of SQL Statements in SAP HANA"},"content":{"rendered":"<p>With this introductory SAP HANA SQL tutorial, we will start with learning the SQL implementation on SAP HANA database. SQL is an integral part of working with SAP HANA. So, let us quickly begin with learning some basics of SQL in SAP HANA.<\/p>\n<h3>Introduction to SAP HANA SQL<\/h3>\n<p>SQL stands for Structured Query Language which interacts with relational databases. It is a standardized language that is used to store, manipulate and retrieve data from the different relational databases such as Oracle, MySQL, etc.<\/p>\n<p>SAP HANA users can create SQL scripts and apply complex business logic to the database manipulating data as per their requirement.<\/p>\n<p>For using SQL in SAP HANA, the basic knowledge of SQL includes <strong>SQL data types<\/strong>, functions, expressions, operators, sequences, triggers, synonyms, script,\u00a0explain plans, etc.<\/p>\n<p>You can add comments in a SQL script to make notes and improve the understanding of the script. The comments can be added in two ways; either by adding the comment after double hyphens \u201c&#8211;\u201d or between \u201c\/*\u201d and \u201c*\/\u201d. Although, the SQL parser ignores the comments.<\/p>\n<h3>Types of SQL Statements in SAP HANA<\/h3>\n<p>SAP HANA supports various\u00a0<strong>SQL statements\u00a0<\/strong>such as:<\/p>\n<h4>1. Data Manipulation Language Statements<\/h4>\n<p>We use the data manipulation language (DML) within schema objects to manipulate and manage data in them. Generally used DML keywords are <strong>SELECT<\/strong> (to retrieve data from database), <strong>INSERT<\/strong> (to add data into a data table) and <strong>UPDATE<\/strong> (to update data that already exists in a table).<\/p>\n<h4>2. Data Definition Language Statements<\/h4>\n<p>We use the DDL statements and keywords to define the structure of data in databases and schemas. Commonly used DDL keywords are <strong>CREATE<\/strong> (creates objects in the database),<strong> ALTER<\/strong> (alters the database structure), <strong>DROP<\/strong> (deletes or drops objects from the database).<\/p>\n<h4>3. Data Control Language Statements<\/h4>\n<p>We use the DCL statements to control user access and privileges to the database. Commonly used DCL keywords are <strong>GRANT<\/strong> (to give access privilege to database to the users) and <strong>REVOKE<\/strong> (to take back the access privileges given using GRANT command).<\/p>\n<h4>4. Backup and Recovery Statements<\/h4>\n<p>Backup and recovery statements enable users to perform backup and recovery operations on the HANA database.<\/p>\n<h4>5. Access Control Statements<\/h4>\n<p>Access control statements allow database administrators to create, alter and drop access to the HANA database.<\/p>\n<h4>6. Data Import Export Statements<\/h4>\n<p>Data import export statements enable import and export operations on data from the HANA database.<\/p>\n<h4>7. JSON Document Store Statements<\/h4>\n<p>These statements enable users to use the SAP HANA database in the form of a JSON document store.<\/p>\n<h4>8. Encryption Statements<\/h4>\n<p>Encryption statements allow database administrators to work with encrypted data in the HANA database.<\/p>\n<h4>9. Tenant Database Management Statements<\/h4>\n<p>Tenant database management statements manage the SAP HANA tenant databases.<\/p>\n<h4>10. Procedural Statements<\/h4>\n<p>The procedural statements allow users to manage both the system and user-defined procedures for data in HANA database.<\/p>\n<h4>11. Transaction Management Statements<\/h4>\n<p>These statements manage transactions in the SAP HANA database.<\/p>\n<h4>12. Session Management Statements<\/h4>\n<p>We use these statements to manage database sessions.<\/p>\n<h4>13. System Management Statements<\/h4>\n<p>These statements enable users to manage system configuration settings in the HANA database.<\/p>\n<h4>14. Workload Management Statements<\/h4>\n<p>These statements manage both the workload classes and mappings.<\/p>\n<h3>Key Tasks of SQL in SAP HANA<\/h3>\n<p>In SAP HANA, we use SQL statements to perform five basic tasks as mentioned below:<\/p>\n<ul>\n<li>Data manipulation<\/li>\n<li>System management<\/li>\n<li>Schema definition and manipulation<\/li>\n<li>Session management<\/li>\n<li>Transaction management<\/li>\n<\/ul>\n<h3>Significance of SQL in SAP HANA<\/h3>\n<p>SQL and SQL scripting holds great importance in SAP HANA because a database only understands a standardized language like SQL. Whenever an SAP HANA user wishes to work with data stored in the HANA database, the interaction happens through SQL.<\/p>\n<p>Using SQL keywords, SQL expressions, and SQL functions, one can efficiently access data from the databases, transform it, and perform other management tasks on the system.<\/p>\n<p>In addition to this, while making information models, SQL plays an important role. Especially in creating <strong>SAP HANA calculation views<\/strong>, SQL scripting is used to create procedures and apply complex logic and calculations to the data residing in the database.<\/p>\n<h3>Summary<\/h3>\n<p>This concludes our introductory discussion on SQL in SAP HANA. In the upcoming tutorials, we will cover different elements of SQL used in SAP HANA.<\/p>\n<p>Did you like our explanation? We will wait for your feedback and suggestions. See you in our next tutorial!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With this introductory SAP HANA SQL tutorial, we will start with learning the SQL implementation on SAP HANA database. SQL is an integral part of working with SAP HANA. So, let us quickly begin&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":55853,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18002],"tags":[19681,19682,19683],"class_list":["post-55830","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sap-hana","tag-sap-hana-sql","tag-sap-hana-sql-statements","tag-sql-tasks-in-sap-hana"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SAP HANA SQL - An Ultimate Cheat Sheet of SQL Statements in SAP HANA - DataFlair<\/title>\n<meta name=\"description\" content=\"With SAP HANA SQL tutorial, understand all the SQL statements supported by SAP HANA database, their tasks and importance in SAP HANA. Learn them now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SAP HANA SQL - An Ultimate Cheat Sheet of SQL Statements in SAP HANA - DataFlair\" \/>\n<meta property=\"og:description\" content=\"With SAP HANA SQL tutorial, understand all the SQL statements supported by SAP HANA database, their tasks and importance in SAP HANA. Learn them now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-06T07:29:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-04T07:42:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/05\/SAP-HANA-SQL-Statements-Tutorial.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SAP HANA SQL - An Ultimate Cheat Sheet of SQL Statements in SAP HANA - DataFlair","description":"With SAP HANA SQL tutorial, understand all the SQL statements supported by SAP HANA database, their tasks and importance in SAP HANA. Learn them now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/","og_locale":"en_US","og_type":"article","og_title":"SAP HANA SQL - An Ultimate Cheat Sheet of SQL Statements in SAP HANA - DataFlair","og_description":"With SAP HANA SQL tutorial, understand all the SQL statements supported by SAP HANA database, their tasks and importance in SAP HANA. Learn them now!","og_url":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2019-05-06T07:29:58+00:00","article_modified_time":"2021-12-04T07:42:44+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/05\/SAP-HANA-SQL-Statements-Tutorial.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"SAP HANA SQL &#8211; An Ultimate Cheat Sheet of SQL Statements in SAP HANA","datePublished":"2019-05-06T07:29:58+00:00","dateModified":"2021-12-04T07:42:44+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/"},"wordCount":716,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/05\/SAP-HANA-SQL-Statements-Tutorial.jpg","keywords":["SAP HANA SQL","SAP HANA SQL Statements","SQL Tasks in SAP HANA"],"articleSection":["SAP HANA Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/sap-hana-sql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/","url":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/","name":"SAP HANA SQL - An Ultimate Cheat Sheet of SQL Statements in SAP HANA - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/05\/SAP-HANA-SQL-Statements-Tutorial.jpg","datePublished":"2019-05-06T07:29:58+00:00","dateModified":"2021-12-04T07:42:44+00:00","description":"With SAP HANA SQL tutorial, understand all the SQL statements supported by SAP HANA database, their tasks and importance in SAP HANA. Learn them now!","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/sap-hana-sql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/05\/SAP-HANA-SQL-Statements-Tutorial.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/05\/SAP-HANA-SQL-Statements-Tutorial.jpg","width":802,"height":420,"caption":"SAP HANA SQL Statements Tutorial"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/sap-hana-sql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"SAP HANA Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/sap-hana\/"},{"@type":"ListItem","position":3,"name":"SAP HANA SQL &#8211; An Ultimate Cheat Sheet of SQL Statements in SAP HANA"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/55830","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=55830"}],"version-history":[{"count":13,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/55830\/revisions"}],"predecessor-version":[{"id":104924,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/55830\/revisions\/104924"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/55853"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=55830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=55830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=55830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}