A new database system named KEGG is being organised to computerize functional aspects of genes and genomes in terms of the binary relations of interacting molecules or genes. We are currently working on the metabolic pathway database that is composed of three interconnected sections: genes, molecules, and pathways, which are also linked to a number of existing databases through our DBGET retrieval system. Here we present the basic concept of binary relations and hierarchical classifications to represent the metabolic pathway data. The database operations are then defined as an extension of the relational operations, and the path computation problem is considered as a deduction from binary relations. An example of using KEGG for the functional prediction of genomic sequences is presented.