Icon

Exercise2

<p><strong>Chapter 2/Exercise 2</strong></p><p>This exercise reads the dataset <em>cars-85</em> from the <em>KCBBook.sqlite</em> database, prepared in Chapter2/Exercise 1. The goal is to read data from a database and practice a bit of in-database processing with database nodes and SQL queries.</p><p>To read the database start with a connector node, either the generic <em>DB Connector</em> node or the dedicated <em>SQLite Connector</em> node.</p><p>Pre-process the dataset with database nodes or SQL queries as follows:</p><ol><li><p>Exclude "symboling" and "normalized losses".</p></li><li><p>Keep only BMW and Audi cars.</p></li></ol><p><strong>Note:</strong> The generic <em>DB Connector</em> node requires an absolute file path to the <em>KCBBook.sqlite</em> file. Adjust the Database URL in the node configuration as follows: <em>jdbc:sqlite://</em><strong><em>&lt;path to KCBBook.sqlite&gt;</em></strong>.</p>

Workflow: Chapter 2/Exercise 2


This exercise reads the dataset cars-85 from the KCBBook.sqlite database, prepared in Chapter2/Exercise 1. The goal is to read data from a database and practice a bit of in-database processing with database nodes and SQL queries.

To read the database start with a connector node, either the generic DB Connector node or the dedicated SQLite Connector node.

Pre-process the dataset with database nodes or SQL queries as follows:

  1. Exclude "symboling" and "normalized losses".

  2. Keep only BMW and Audi cars.

Note: The generic DB Connector node requires an absolute file path to the KCBBook.sqlite file. Adjust the Database URL in the node configuration as follows: jdbc:sqlite://<path to KCBBook.sqlite>.

Accessing database

Note:

Adjust the Database URL as follows: jdbc:sqlite://<path to KCBBook.sqlite>

DB Reader
SELECT all columns from cars85 WHERE make = "bmw" OR make = "audi"
DB Query Reader
Select make = "bmw" ORmake = "audi"
DB Row Filter
Exclude "symboling" and"normalized losses"
DB Column Filter
SELECT * from cars85
DB Table Selector
DB Reader
SELECT * from cars85 WHERE make = "bmw" OR make = "audi"
DB Table Selector
Generic connectorto SQLite DBKCBBook.sqlite
DB Connector
Connect to SQLite DBKCBBook.sqlite
SQLite Connector
Exclude "symboling" and"normalized losses"
DB Column Filter

Nodes

Extensions

Links