Foodmart database in hsqldb format

this is a fork of the last version of the hsqldb foodmart database, updated to work with hsqldb 2.5.1

License

License

Categories

Categories

Data
GroupId

GroupId

org.ojbc
ArtifactId

ArtifactId

foodmart-data-hsqldb
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Foodmart database in hsqldb format
this is a fork of the last version of the hsqldb foodmart database, updated to work with hsqldb 2.5.1
Project URL

Project URL

http://www.ojbc.org/
Source Code Management

Source Code Management

https://github.com/ojbc/foodmart-data-hsqldb

Download foodmart-data-hsqldb

How to add to project

<!-- https://jarcasting.com/artifacts/org.ojbc/foodmart-data-hsqldb/ -->
<dependency>
    <groupId>org.ojbc</groupId>
    <artifactId>foodmart-data-hsqldb</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.ojbc/foodmart-data-hsqldb/
implementation 'org.ojbc:foodmart-data-hsqldb:1.0.0'
// https://jarcasting.com/artifacts/org.ojbc/foodmart-data-hsqldb/
implementation ("org.ojbc:foodmart-data-hsqldb:1.0.0")
'org.ojbc:foodmart-data-hsqldb:jar:1.0.0'
<dependency org="org.ojbc" name="foodmart-data-hsqldb" rev="1.0.0">
  <artifact name="foodmart-data-hsqldb" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.ojbc', module='foodmart-data-hsqldb', version='1.0.0')
)
libraryDependencies += "org.ojbc" % "foodmart-data-hsqldb" % "1.0.0"
[org.ojbc/foodmart-data-hsqldb "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.hsqldb : hsqldb jar 2.5.1

Project Modules

There are no modules declared in this project.

foodmart-data-hsqldb

Foodmart data set in hsqldb format

OJBC Fork

Note that this is a fork of the last version of the hsqldb foodmart database, updated to work with hsqldb 2.5.1.

The fork essentially:

  • Updates the pom to break dependency on the net.hydromatic parent in Julian's repo and get rid of all his scm/git stuff
  • Updates the hsqldb dependency
  • Updates the .properties and .script files to hsqldb 2.5.1 compatibility

We've left everything else as-is, including the Apache license and notice.

(end OJBC Fork info)

...

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

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

Schema

Foodmart contains 37 tables:

  • 7 fact tables: sales_fact_1997, sales_fact_1998, sales_fact_dec_1998, inventory_fact_1997, inventory_fact_1998, salary, expense_fact
  • 19 dimension tables: product, customer, time_by_day, employee and more
  • 11 aggregate tables

Its size is about 24MB uncompressed, 8MB compressed.

Here is a schema diagram:

Foodmart 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>foodmart-data-hsqldb</artifactId>
  <version>0.4</version>
</dependency>

Now you can connect using Java code:

import java.sql.Connection;

Connection connection = DriverManager.getConnection("jdbc:hsqldb:res:foodmart");
Statement statement = connection.createStatement();
ResultSet resultSet =
  statement.executeQuery("select \"employee_id\", \"full_name\"\n"
      + "from \"foodmart\".\"employee\");
while (resultSet.next()) {
  System.out.println(resultSet.getInt(1) + ":" + resultSet.getString(2));
}
resultSet.close();
statement.close();
connection.close();

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

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

Get foodmart-data-hsqldb

From Maven

Get foodmart-data-hsqldb from Maven Central:

<dependency>
  <groupId>net.hydromatic</groupId>
  <artifactId>foodmart-data-hsqldb</artifactId>
  <version>0.4</version>
</dependency>

Download and build

$ git clone git://github.com/julianhyde/foodmart-data-hsqldb.git
$ cd foodmart-data-hsqldb
$ mvn install

Make a release

See hydromatic-parent.

See also

Similar data sets:

More information

org.ojbc

Open Justice Broker Consortium

Versions

Version
1.0.0