SQL is a standardized language for defining and manipulating data in a relational
database. You can use the Query workspace interface in watsonx.data to run SQL queries and scripts
against your data.
About this task
To run the SQL queries, do the following steps:
Procedure
- Log in to the watsonx.data
console.
- From the navigation menu, select SQL. The Query
workspace page opens.
- Browse to explore the following options in the Query workspace
page.
- Engine: To select an engine and view the associated catalogs.
- Search for loaded tables: To search the tables and columns.
- Saved queries: To view the saved queries.
- Worksheet: To write SQL queries.
The Query workspace page provides basic options to
undo, redo, cut,
copy, paste, save,
clear, and delete.
Format selection option is enabled only when an SQL statement in a query
worksheet is selected. The Format worksheet option formats all the content in
the worksheet. Comment selection is used to explain sections of SQL
statements.
The Delete option is enabled only after an SQL query is saved.
- Select an engine from the Engine menu.
- Select the catalog, schema, table, or column in which you want to run the
query.
- Click the overflow menu and select the required query.
- For a catalog and schema, you can run the Generate Path query.
- For a table, you can run the Generate path, Generate
SELECT, Generate ALTER, and Generate DROP
query.
- For a column, you can run the Generate path, Generate
SELECT, and Generate DROP query.
- Click Run on to run the query.
- Select Result set or Details tab to view
the results. Click the Download icon to export the result set and details to
a CSV file.
- Click the Save icon to save the query. A Save
worksheet confirmation dialog appears.
- Enter worksheet name, click Save.
- Click Saved queries to view the saved queries.
- Click Explain to view the logical or distributed plan of execution
for a specified SQL query. See About Visual Explain for more details.