SAP

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

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

More from Dan van Leeuwen

See all 60 tutorials by Dan van Leeuwen →

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 SQL console
    Open SQL console

    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;

    Change schema to SFLIGHT using SQL
    Change schema to SFLIGHT using SQL

    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.

    Change schema to SFLIGHT using schema selector
    Change schema to SFLIGHT using schema selector

    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
Next