This thesis proposes a formal model for a federation of relational databases with possibly heterogeneous schemas. The Federation Model is comprehensive enough for: (i) capturing the diversity of schemas arising in practice, allowing a symmetric treatment of data and schema, and (ii) capturing the complete space of dimensional representations of data, fully exploiting the n logical dimensions structured along the three physical dimensions implicit in the relational model--row, column, and relation. An n-dimensional query language called nD-SQL is also proposed. This language makes use of the Federation Model and is capable of: (a) resolving schematic discrepancies among a collection of relational databases or data marts with heterogeneous schemas, and (b) supporting a whole range of multiple granularity aggregation queries like CUBE, ROLLUP, and DRILLDOWN, but, to an arbitrary, user controlled, level of resolution. In addition, nD-SQL can express queries that restructure data conforming to any particular dimensional representation into any other. The semantics of nD-SQL is downward compatible with the popular SQL language. The thesis also proposes an extension to relational algebra, capable of restructuring, called restructuring relational algebra (RRA). (Abstract shortened by UMI.)