Skip to main content

VeloDB Cloud Quick Start

Estimated completion time: 20 minutes

This quick start shows you how to create a VeloDB Cloud warehouse, load the SSB-Flat dataset, and run analytical queries.

Step 1. Create your account

You need to use a business email address to sign up. Personal emails are not supported. No credit card is required. The free trial gives you US$300 in credits and 30 days to explore VeloDB Cloud.

To create a new account:

  1. Go to the VeloDB Cloud console and then click Sign up.

  2. Choose one of the following sign-up methods and complete the registration.

    • Google: single sign-on with your Google account
    • Microsoft: single sign-on with your Microsoft account
    • Email: traditional business email and password registration

Step 2. Create a warehouse

To create a warehouse:

  1. Log in to the VeloDB Cloud console.

  2. In the upper-left corner, click Create New Warehouse.

  3. In the SaaS area, click Create Warehouse.

  4. Enter the following information:

    • Warehouse Name: enter velodb-quickstart.

    • Cloud Platform: select AWS.

    • Region: choose a region close to you for lowest latency. The following regions are available for the sample dataset:

      • us-east-1 (US East, N. Virginia)
      • us-west-1 (US West, N. California)
      • us-west-2 (US West, Oregon)
      • eu-central-1 (Europe, Frankfurt)
      • eu-west-1 (Europe, Ireland)
      • ap-southeast-1 (Asia Pacific, Singapore)
      • ap-northeast-1 (Asia Pacific, Tokyo)
      • me-south-1 (Middle East, Bahrain)
  5. You can keep the default cluster specification (4 vCPU, 32 GB RAM, and 200 GB cache) and advanced settings for this tutorial. Click Get started to provision the warehouse.

It usually takes 3 to 5 minutes to provision a warehouse. Continue when the warehouse status changes to Running.

Step 3. Connect to your warehouse

It is recommended that you use the built-in SQL Editor to connect to your warehouse. For other connection methods, see Connecting by MySQL Protocol.

To connect to your warehouse:

  1. In the left navigation pane, click SQL Editor.

  2. Enter your warehouse password and then click Connect.

  3. Run the following statement to verify the connection:

    SHOW DATABASES;

    You can see at least the following system database:

    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    +--------------------+

On the SQL Editor home page, you can explore the following use case demos and SQL templates to see how VeloDB Cloud works and learn how common data analysis tasks are performed with SQL.

  • Use case demos

    • Real-time analytics: track product activity and power live dashboards in real time.
    • Observability: search and troubleshoot logs, metrics, and traces at scale.
  • SQL templates

    • Complex Joins: learn various join queries step by step: INNER, LEFT, RIGHT, FULL, CROSS, LEFT SEMI, and LEFT ANTI.
    • Full Text Search: search documents and logs using text indexes.
    • Semi-Structured Data: store and query flexible JSON schemas without compromising SQL performance.

Step 4. Preview the SSB-Flat benchmark dataset from Amazon S3

The public SSB-Flat SF1 dataset contains about 6 million rows in a denormalized table. You can preview the file, create a table, load the Parquet file, and verify the row count. You do not need Amazon S3 credentials because the sample dataset is publicly accessible.

To preview the dataset from Amazon S3:

  1. Replace every occurrence of <region> in the following statement with the AWS region where your warehouse is located, such as us-east-1.

    -- Replace <region> with your warehouse AWS region.
    -- The bucket name, endpoint, and region must use the same value.
    SELECT
    lo_orderkey,
    lo_orderdate,
    c_name,
    c_nation,
    lo_revenue,
    p_brand
    FROM S3(
    "uri" = "s3://velodb-import-data-<region>/ssb-flat-sf1/ssb_flat_001.parquet",
    "format" = "parquet",
    "s3.endpoint" = "s3.<region>.amazonaws.com",
    "s3.region" = "<region>"
    )
    LIMIT 5;
  2. Run the statement in the SQL Editor.

Expected output
lo_orderkeylo_orderdatec_namec_nationlo_revenuep_brand
11996-08-30Customer#000003506INDIA41169.9MFGR#327
11998-12-27Customer#000020886KENYA43440.7MFGR#217
11994-11-01Customer#000011876ROMANIA8084.1MFGR#510
11995-05-28Customer#000012832KENYA34849.0MFGR#531
11996-08-05Customer#000008486INDONESIA36930.1MFGR#409

Step 5. Create the table and load data

Run the following script in the SQL Editor in order. Replace <region> with the region where your warehouse is located.

View the SQL statements
-- 1. Create a database for the tutorial.
CREATE DATABASE IF NOT EXISTS ssb;
USE ssb;

-- 2. Create a wide table that matches the Parquet file schema.
CREATE TABLE IF NOT EXISTS ssb_flat (
lo_orderkey BIGINT NOT NULL,
lo_linenumber BIGINT NOT NULL,
lo_custkey BIGINT NOT NULL,
lo_partkey BIGINT NOT NULL,
lo_suppkey BIGINT NOT NULL,
lo_orderdate DATE NOT NULL,
lo_commitdate DATE NOT NULL,
lo_orderpriority VARCHAR(15) NOT NULL,
lo_shippriority BIGINT NOT NULL,
lo_shipmode VARCHAR(10) NOT NULL,
lo_year INT NOT NULL,
lo_month INT NOT NULL,
lo_weeknum INT NOT NULL,
d_datekey BIGINT NOT NULL,
d_dayofweek VARCHAR(10) NOT NULL,
d_month VARCHAR(10) NOT NULL,
d_yearmonth VARCHAR(10) NOT NULL,
lo_quantity BIGINT NOT NULL,
lo_extendedprice DOUBLE NOT NULL,
lo_discount DOUBLE NOT NULL,
lo_revenue DOUBLE NOT NULL,
lo_supplycost DOUBLE NOT NULL,
lo_tax DOUBLE NOT NULL,
c_custkey BIGINT NOT NULL,
c_name VARCHAR(25) NOT NULL,
c_nation VARCHAR(15) NOT NULL,
c_region VARCHAR(12) NOT NULL,
c_city VARCHAR(10) NOT NULL,
c_mktsegment VARCHAR(10) NOT NULL,
s_suppkey BIGINT NOT NULL,
s_name VARCHAR(25) NOT NULL,
s_nation VARCHAR(15) NOT NULL,
s_region VARCHAR(12) NOT NULL,
s_city VARCHAR(10) NOT NULL,
p_partkey BIGINT NOT NULL,
p_name VARCHAR(22) NOT NULL,
p_brand VARCHAR(9) NOT NULL,
p_category VARCHAR(7) NOT NULL,
p_mfgr VARCHAR(6) NOT NULL,
p_color VARCHAR(11) NOT NULL,
p_type VARCHAR(25) NOT NULL,
p_size BIGINT NOT NULL,
p_container VARCHAR(10) NOT NULL,
INDEX idx_p_type (p_type) USING INVERTED PROPERTIES("parser" = "english")
)
DUPLICATE KEY(lo_orderkey)
DISTRIBUTED BY HASH(lo_orderkey) BUCKETS 48;

-- 3. Load the Parquet file from the public sample bucket.
-- Replace <region> in the bucket name, endpoint, and region option.
INSERT INTO ssb.ssb_flat
SELECT *
FROM S3(
"uri" = "s3://velodb-import-data-<region>/ssb-flat-sf1/*.parquet",
"format" = "parquet",
"s3.endpoint" = "s3.<region>.amazonaws.com",
"s3.region" = "<region>"
);

-- 4. Verify that the data was loaded.
SELECT COUNT(*) AS total_rows FROM ssb.ssb_flat;

The load usually takes about 30 seconds to 1 minute. The expected output is as follows:

+------------+
| total_rows |
+------------+
| 6000000 |
+------------+

Step 6. Run analytical queries

The following queries use the same dataset to demonstrate common analytical workloads. Expand a query to copy and run it in the SQL Editor.

Query 1: Aggregate revenue by region

View query and expected output

This query groups 6 million rows by customer region and calculates several metrics in one scan.

SELECT
c_region,
COUNT(*) AS order_count,
SUM(lo_revenue) AS total_revenue,
AVG(lo_discount) AS avg_discount
FROM ssb.ssb_flat
GROUP BY c_region
ORDER BY total_revenue DESC;

Expected output:

|  c_region   | order_count | total_revenue  | avg_discount |
| :---------- | ----------: | -------------: | -----------: |
| AFRICA | 1,209,695 | 30,045,700,000 | 0.0499855 |
| AMERICA | 1,206,823 | 29,951,300,000 | 0.0500156 |
| EUROPE | 1,196,670 | 29,738,000,000 | 0.0499963 |
| ASIA | 1,194,609 | 29,685,100,000 | 0.0500179 |
| MIDDLE EAST | 1,192,203 | 29,608,000,000 | 0.0499894 |

Query 2: Calculate year-over-year growth

View query and expected output

This query first calculates annual revenue and then compares each year with the previous year by using the LAG window function.

WITH yearly_revenue AS (
SELECT
lo_year,
SUM(lo_revenue) AS yearly_revenue
FROM ssb.ssb_flat
GROUP BY lo_year
)
SELECT
lo_year,
yearly_revenue,
LAG(yearly_revenue) OVER (ORDER BY lo_year) AS prev_year_revenue,
ROUND(
(yearly_revenue - LAG(yearly_revenue) OVER (ORDER BY lo_year))
/ LAG(yearly_revenue) OVER (ORDER BY lo_year) * 100,
2
) AS yoy_growth_pct
FROM yearly_revenue
ORDER BY lo_year;

Expected output:

| lo_year | yearly_revenue | prev_year_revenue | yoy_growth_pct |
| ------: | -------------: | ----------------: | -------------: |
| 1992 | 21,353,120,000 | null | null |
| 1993 | 21,286,670,000 | 21,353,120,000 | -0.31 |
| 1994 | 21,253,220,000 | 21,286,670,000 | -0.16 |
| 1995 | 21,323,680,000 | 21,253,220,000 | 0.33 |
| 1996 | 21,287,370,000 | 21,323,680,000 | -0.17 |
| 1997 | 21,269,030,000 | 21,287,370,000 | -0.09 |
| 1998 | 21,255,070,000 | 21,269,030,000 | -0.07 |

Query 3: Classify profit by region pair

View query and expected output

This query uses a common table expression (CTE) to calculate revenue, cost, and profit for each customer and supplier region pair, then assigns a profit tier.

WITH regional_stats AS (
SELECT
c_region,
s_region,
SUM(lo_revenue) AS revenue,
SUM(lo_supplycost) AS cost,
SUM(lo_revenue - lo_supplycost) AS profit
FROM ssb.ssb_flat
GROUP BY c_region, s_region
)
SELECT
c_region,
s_region,
revenue,
cost,
profit,
CASE
WHEN profit > 1000000000 THEN 'High'
WHEN profit > 500000000 THEN 'Medium'
ELSE 'Low'
END AS profit_tier
FROM regional_stats
ORDER BY profit DESC;

Expected output:

|  c_region   |  s_region   |      revenue      |       cost        |      profit       | profit_tier |
| ----------- | ----------- | ----------------- | ----------------- | ----------------- | ----------- |
| AFRICA | ASIA | 6308179893.95 | 3486412509.099979 | 2821767384.849996 | High |
| AMERICA | ASIA | 6299472183.030003 | 3481502424.920003 | 2817969758.110002 | High |
| EUROPE | ASIA | 6279793523.860003 | 3470234567.270004 | 2809558956.589981 | High |
| ASIA | ASIA | 6251013360.850019 | 3455023735.229992 | 2795989625.620012 | High |
| MIDDLE EAST | ASIA | 6226175855.609989 | 3440868255.400005 | 2785307600.209991 | High |
| AFRICA | AMERICA | 6156561146.660022 | 3402251879.79002 | 2754309266.870004 | High |
| AMERICA | AMERICA | 6134846380.700005 | 3389957171.989984 | 2744889208.710003 | High |
| ASIA | AMERICA | 6112336372.200031 | 3377999137.050002 | 2734337235.149994 | High |
| EUROPE | AMERICA | 6081864808.150005 | 3360613000.930011 | 2721251807.219994 | High |
| AFRICA | MIDDLE EAST | 6081802873.460032 | 3361054388.589974 | 2720748484.870011 | High |
| MIDDLE EAST | AMERICA | 6078738337.439955 | 3359040139.999989 | 2719698197.439994 | High |
| AMERICA | MIDDLE EAST | 6044373110.950006 | 3339939930.010002 | 2704433180.939993 | High |
| EUROPE | MIDDLE EAST | 6029097695.749996 | 3331684469.950008 | 2697413225.800008 | High |
| MIDDLE EAST | MIDDLE EAST | 6004407405.769994 | 3318105568.41 | 2686301837.359982 | High |
| ASIA | MIDDLE EAST | 6002040685.539988 | 3317419716.880013 | 2684620968.660001 | High |
| AMERICA | EUROPE | 5868639217.559986 | 3243382027.629997 | 2625257189.930006 | High |
| AFRICA | EUROPE | 5857173568.279973 | 3236751360.010001 | 2620422208.270015 | High |
| EUROPE | EUROPE | 5808918805.700056 | 3210288249.239999 | 2598630556.46002 | High |
| ASIA | EUROPE | 5802058613.949984 | 3206083222.509991 | 2595975391.440015 | High |
| MIDDLE EAST | EUROPE | 5765263879.109998 | 3185565303.729995 | 2579698575.38 | High |
| AFRICA | AFRICA | 5641988747.209981 | 3117227714.580005 | 2524761032.629989 | High |
| AMERICA | AFRICA | 5603968168.729999 | 3096609224.189989 | 2507358944.539989 | High |
| EUROPE | AFRICA | 5538365842.509956 | 3061159209.999993 | 2477206632.509991 | High |
| MIDDLE EAST | AFRICA | 5533428588.829963 | 3057996591.359988 | 2475431997.470007 | High |
| ASIA | AFRICA | 5517658646.889992 | 3049143008.43999 | 2468515638.449999 | High |

Query 4: Compare revenue across years

View query and expected output

This query calculates revenue for 1997 and 1993 separately, then joins the two results by nation to calculate growth.

SELECT
current_year.c_nation,
current_year.revenue_1997,
previous_year.revenue_1993,
ROUND(
(current_year.revenue_1997 - previous_year.revenue_1993)
/ previous_year.revenue_1993 * 100,
2
) AS growth_pct
FROM (
SELECT
c_nation,
SUM(lo_revenue) AS revenue_1997
FROM ssb.ssb_flat
WHERE lo_year = 1997
GROUP BY c_nation
) AS current_year
JOIN (
SELECT
c_nation,
SUM(lo_revenue) AS revenue_1993
FROM ssb.ssb_flat
WHERE lo_year = 1993
GROUP BY c_nation
) AS previous_year
ON current_year.c_nation = previous_year.c_nation
ORDER BY growth_pct DESC;

Expected output:

|    c_nation    |   revenue_1997    |   revenue_1993    | growth_pct |
| -------------- | ----------------- | ----------------- | ---------- |
| VIETNAM | 861742117.1200002 | 849524428.86 | 1.44 |
| INDIA | 858021099.5899997 | 848747932.0599976 | 1.09 |
| FRANCE | 828152348.6300011 | 820742266.8999995 | 0.9 |
| CANADA | 867249205.9799998 | 860651769.6600009 | 0.77 |
| JORDAN | 872555078.1599988 | 868477295.240001 | 0.47 |
| UNITED STATES | 857983958.0000002 | 854688778.0799984 | 0.39 |
| EGYPT | 853587110.9900001 | 850470546.6699996 | 0.37 |
| GERMANY | 877544239.7799996 | 874933908.9999999 | 0.3 |
| ARGENTINA | 840003820.6700027 | 839051954.4199992 | 0.11 |
| JAPAN | 857954224.1699994 | 857113959.0700003 | 0.1 |
| INDONESIA | 843047874.9299989 | 842281246.4400009 | 0.09 |
| KENYA | 896688884.9200003 | 896630675.249999 | 0.01 |
| ETHIOPIA | 868099455.4700007 | 868054779.200002 | 0.01 |
| SAUDI ARABIA | 813165251.609999 | 813230048.6399992 | -0.01 |
| UNITED KINGDOM | 852985742.6800001 | 854362180.2299994 | -0.16 |
| CHINA | 828729924.8000005 | 831193171.5400004 | -0.3 |
| MOROCCO | 866296494.640001 | 869258255.8399996 | -0.34 |
| IRAN | 844108988.5500003 | 847694392.2700007 | -0.42 |
| IRAQ | 834998786.2199996 | 839055379.3399997 | -0.48 |
| MOZAMBIQUE | 843338891.3600006 | 848104156.3000004 | -0.56 |
| RUSSIA | 852158407.3799964 | 859764371.4599993 | -0.88 |
| ALGERIA | 811725668.2200012 | 819879807.9299996 | -0.99 |
| ROMANIA | 828115040.9499991 | 838516293.6599995 | -1.24 |
| PERU | 857870321.4799991 | 869440797.4700015 | -1.33 |
| BRAZIL | 852908668.5100011 | 864800060.0700023 | -1.38 |

Query 5: Search product types

View query and expected output

This query searches the indexed p_type column for product types that contain STEEL, then aggregates matching rows by product type and brand.

SELECT
p_type,
p_brand,
COUNT(*) AS product_count,
SUM(lo_revenue) AS total_revenue
FROM ssb.ssb_flat
WHERE p_type MATCH 'STEEL'
GROUP BY p_type, p_brand
ORDER BY total_revenue DESC
LIMIT 10;

Expected output:

|         p_type          | p_brand  | product_count | total_revenue |
| ----------------------- | -------- | ------------- | ------------- |
| PROMO BRUSHED STEEL | MFGR#102 | 494 | 13207958.4 |
| SMALL BRUSHED STEEL | MFGR#208 | 516 | 13045097.46 |
| STANDARD POLISHED STEEL | MFGR#507 | 520 | 13018194.76 |
| SMALL POLISHED STEEL | MFGR#411 | 516 | 12503537.26 |
| STANDARD BRUSHED STEEL | MFGR#507 | 524 | 12437392.27 |
| SMALL PLATED STEEL | MFGR#407 | 482 | 12230981.37 |
| MEDIUM POLISHED STEEL | MFGR#232 | 445 | 11774221 |
| MEDIUM PLATED STEEL | MFGR#237 | 477 | 11753983.01 |
| MEDIUM BRUSHED STEEL | MFGR#403 | 455 | 11748195.26 |
| SMALL BRUSHED STEEL | MFGR#536 | 477 | 11620434.36 |

What's next