+

Search Tips  |   Advanced Search

IBM Cloud SQL Query

In this IBM Cloud SQL Query tutorial, we'll set you up to begin querying rectangular data in IBM Cloud Object Storage and storing the results in Object Storage.


Before you begin

Before you can run SQL queries, you need to have one or more Cloud Object Storage buckets to hold the data to be analyzed and to hold the query results. Cloud Object Storage offers several plans, including a free "Lite" plan. To create a Cloud Object Storage instance:

  1. Go to the page.
  2. Select one of the plans and create the service.

    To find your Cloud Object Storage instance at a later point of time, go to your . (If you do not see it in the list, select the resource group "All Resources".)

We can now manage and browse the buckets and data the instance contains. Click here for more information about how to use Cloud Object Storage.


Step 1: Create your SQL Query service instance

  1. Go to the and search for SQL Query.
  2. Click SQL Query to open the Catalog details page.
  3. Select the Lite plan and Click Create to create an instance of the service.
  4. Click Launch SQL Query UI on the Dashboard page to open the SQL Query Console. When you do this for the first time, the SQL Query service automatically creates a bucket for you in your Cloud Object Storage instance. It uses this bucket as the default target for your query results.


Step 2: Execute one of the samples to see how to use the service

  1. Select a sample query. This loads it into the editor. The input data used by the sample queries is available in a publicly accessible bucket.
  2. The Target field is automatically filled in with the unique resource identifier (URI) of your default bucket. We can use this bucket or specify an INTO clause in your query.
  3. Click Run to run the query. The query result is displayed below the editor.
  4. Each sample data set is available in each of the supported input data formats (CSV, JSON, ORC, and Parquet). To experiment with different formats, edit the selected sample query and change the specified file name and format. For example, change orders.parquet STORED AS PARQUET to orders.orc STORED AS ORC.


Next steps

To analyze your own data (CSV, JSON, ORC, or Parquet), upload it to an Cloud Object Storage instance and run SQL queries as described here.

For more advanced capabilities, check out these video tutorials: