Giter VIP home page Giter VIP logo

steelwheels-data-hsqldb's Introduction

Build Status

steelwheels-data-hsqldb

Steelwheels data set in hsqldb format

This project contains the Steelwheels data set as an embedded HSQLDB database.

It originated as part of the test suite of the Pentaho Mondrian OLAP engine.

Schema

Steelwheels contains 13 tables:

Table Row count
customer_w_ter 126
customers 126
department_managers 4
employees 23
offices 7
orderdetails 3,001
orderfact 2,996
orders 330
payments 272
products 110
quadrant_actuals 148
time 265
trial_balance 22

Its size is about 1MB uncompressed, 124KB compressed.

Here is a schema diagram:

Steelwheels schema diagram

Using the data set

The data set is packaged as a jar file that is published to Maven Central as a Maven artifact. To use the data in your Java application, add the artifact to your project's dependencies:

<dependency>
  <groupId>net.hydromatic</groupId>
  <artifactId>steelwheels-data-hsqldb</artifactId>
  <version>0.2</version>
</dependency>

Now you can connect using Java code:

import java.sql.Connection;

final String url = "jdbc:hsqldb:res:steelwheels";
final String user = "STEELWHEELS";
final String password = "STEELWHEELS";
final String sql = "select lastname"\n"
    + "from \"steelwheels\".\"employees\"";
try (Connection c = DriverManager.getConnection(url, user, password);
    Statement s = c.createStatement();
    ResultSet r = s.executeQuery(sql)) {
  while (r.next()) {
    System.out.println(r.getString(1));
  }
}

You can also connect using a JDBC interface such as sqlline. Make sure that steelwheels-data-hsqldb.jar is on the class path, and start sqlline:

$ ./sqlline
sqlline version 1.12.0
sqlline> !connect jdbc:hsqldb:res:steelwheels sa ""
0: jdbc:hsqldb:res:steelwheels> select count(*) from "steelwheels"."employees";
+----------------------+
|          C1          |
+----------------------+
| 23                   |
+----------------------+
1 row selected (0.004 seconds)
0: jdbc:hsqldb:res:steelwheels> !quit

If you use username and password "STEELWHEELS" and "STEELWHEELS", the default schema is "steelwheels", so you can omit the table prefix, if you wish:

$ ./sqlline
sqlline version 1.12.0
sqlline> !connect jdbc:hsqldb:res:steelwheels STEELWHEELS STEELWHEELS
0: jdbc:hsqldb:res:steelwheels> select count(*) from "employees";
+----------------------+
|          C1          |
+----------------------+
| 23                   |
+----------------------+
1 row selected (0.004 seconds)
0: jdbc:hsqldb:res:steelwheels> !quit

Get steelwheels-data-hsqldb

From Maven

Get steelwheels-data-hsqldb from Maven Central:

<dependency>
  <groupId>net.hydromatic</groupId>
  <artifactId>steelwheels-data-hsqldb</artifactId>
  <version>0.2</version>
</dependency>

Download and build

Java version 8 or higher.

$ git clone git://github.com/julianhyde/steelwheels-data-hsqldb.git
$ cd steelwheels-data-hsqldb
$ ./mvnw install

+On Windows, the last line is

> mvnw install

Make a release

See hydromatic-parent.

See also

Similar data sets:

More information

steelwheels-data-hsqldb's People

Contributors

julianhyde avatar

Watchers

Rohan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.