Run SQL Statements

SQL or Structured Query Language is the standard language for relational database management systems. You can use SQL statements to perform tasks such as retrieving data from a database, updating data on a database, and so on. Some examples of SQL statements are SELECT, INSERT, UPDATE, DELETE, CREATE, and DROP.

To run SQL statements:
  1. In the Oracle Machine Learning home page, click Run SQL Statement. The SQL Query Scratchpad opens.
  2. In the SQL Query Scratchpad, type %sql and press enter.
  3. In the next line, enter the SQL statement that you want to run. If you want to fetch data about product sales, then type SELECT * FROM tablename. For example,
    SELECT * FROM SH.SALES; where, SH is the schema name and SALES is the table that contains the data about product sales in the database.
  4. To run the SQL statement, click run or press Shift+Enter. Once the statement runs successfully, Oracle Machine Learning fetches the data from the database and displays it in a tabular format.
  5. If you want to visualize the data in a different graphical output, then click the icon for the corresponding graph.