X

The Oracle NoSQL Database Blog covers all things Oracle NoSQL Database. On-Prem, Cloud and more.

  • November 2, 2016

Oracle NoSQL Database - SQL Query Overview & Demo

SQL (Structured Query Language) is one of the most popular query languages for accessing databases. Oracle NoSQL database (release 4.2 or later) offers such query feature to simplify application development. Developers can now use their knowledge and experience in SQL for  Oracle NoSQL database.

This blog provides a quick and easy guide to get you started on testing SQL queries in Oracle NoSQL database.

Following steps will guide you through the setup process.

Step 1: Oracle NoSQL Database Setup

  • If you have not installed Oracle NoSQL database, please download the product here. Either enterprise or community edition is fine. Enterprise edition is used in this example.
  • Place the package in /home/oracle/nosql. Follow the commands below to unzip the package and launch KVLite, a single-node Oracle NoSQL database.

    gunzip <name of the downloaded package> Example: gunzip kv-ee-4.2.10.tar.gz

    tar -xvf <name of the gunzipped package> Example: tar -xvf kv-ee-4.2.10.tar

    KVHOME=<directory of the unzipped package> Example: KVHOME=/home/oracle/nosql/kv-4.2.10
    java -jar $KVHOME/lib/kvstore.jar kvlite

Step 2: SQL Test Environment Setup

  • A small sample database and scripts will be used to set up the test environment. Table is used to model the data.
  • Download this demo file. Place and unzip it in the same parent directory where the Oracle NoSQL Database is located. Example: /home/oracle/nosql

    gunzip TestSQL.tar.gz
    tar -xvf TestSQL.tar

  • After the file is unzipped, a folder called TestSQL should appear.
  • Follow the commands below to set up the database and SQL test environment.

    cd TestSQL to open the folder

    testSQL.sh to start testing SQL

Step 3: SQL Testing

  • A file called testSQL.txt (in TestSQL folder) has a collection of sample SQL statements that can be used for testing.
  • For further details on SQL usage in Oracle NoSQL products, please refer to the online documents.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha