SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Query the Database Using SQL Statements

Learn how to create new tables, view table details, join tables, and extract specific data from tables using SQL statements in the SAP HANA database explorer.

Overview

🎓 beginner 10 min. SAP HANA CloudBeginnerSAP HANA CloudSAP HANA DatabaseSql

You will learn

  • โœ”How to query your database using the SAP HANA Cloud Central using SQL Console
  • โœ”How to create new tables
  • โœ”How to join tables
  • โœ”How to extract specific data from tables

Prerequisites

Prerequisites

Steps

Intro

Alex Banner
Alex Banner

Reminder: This tutorial is part of a mission, in which you will help Alex, the CEO of Best Run Travel, to answer a concrete business question with SAP HANA Cloud, SAP HANA database.

Alex needs to know the top 5 partners of their agency and wants to find out the days with maximum booking of each partner.


Step 1 Open the SQL console and set the schema
โ€”

  1. Go to the Instances tab in SAP HANA Cloud Central and open SQL Console.

    Open DBX from HANA Cloud Central
    Open DBX from HANA Cloud Central

    You can also open the SQL console by right-clicking on a database name and selecting Open SQL console or by using the shortcut Ctrl+Alt+C.

  2. Once the SQL console loads, ensure that the current schema is SFLIGHT by checking the top center of the console.

    If not, copy and paste the following statement to the console and run it:

    SQL
    SET SCHEMA SFLIGHT;

    SQL Console, with highlight on Current Schema
    SQL Console, with highlight on Current Schema

    You can also change the schema by clicking on the current schema name in the center of the console, selecting SFLIGHT from the list, and then clicking the Change button.

    Second Option to Change Current Schema in SQL Console
    Second Option to Change Current Schema in SQL Console

    The current schema will then display SFLIGHT.

Step 2 Query the most popular travel agents
+
Step 3 Join tables to find out which agency makes the most bookings
+
Step 4 Find out which days have the most bookings
+
Step 5 Knowledge Check
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Open the SQL console and set the schema 2. Query the most popular travel agents 3. Join tables to find out which agency makes the most bookings 4. Find out which days have the most bookings 5. Knowledge Check

Learn more →