These queries use QUDT to do units conversions. The first query has the specific units written right in the query; but a query like this should probably be parameterized. The second query allows the measured units to be inputs to the query.

The data sets for these queries can be downloaded here:

Query ch14.2 Converting 10 kilometers to miles visit query on

QUDT provides a number of capabilities for managing units. Probably the simplest one is to ask whether two units are commensurate (do they measure the same quantity). This query asks that question for Meters and Feet (in the comments, Joules and Thermal Calories).

If you want to use this query for other units, you can edit the query, and put them in. You'll need to know the QUDT identifiers for the units.

Figure ch14.2 Converting n (units) to (other units) (parameterized) visit query on

This query is the same as the previous one, but with parameters for the units. It also looks up the units by label, so you don't need to know the QUDT name (just the label). This uses a parametrization facility of to let you fill in values for variables before running the query.