# US 2002/0120620 A1 · Method and system for composing a query for a database and traversing the database

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2002/0120620 A1
- Document ID: US20020120620A1
- Status: Published application
- Kind: A1
- Application number: 09/996,127
- Filed: 2001-11-27
- Published: 2002-08-29
- Earliest claimed: 2000-11-30
- Assignees: International Business Machines Corporation
- Inventors: Victor Chan; Fen Wang; Mark W. Hubbard
- Web page: https://patentgrep.com/patent/US20020120620A1

## CPC

- G06F 16/2455: Query execution
- G06F 16/24524: {Access plan code generation and invalidation; Reuse of access plans}
- Y10S 706/922: Computer program preparation
- Y10S 707/99933: Query processing, i.e. searching
- Y10S 707/99934: Query formulation, input preparation, or translation
- Y10S 707/99935: Query augmenting and refining, e.g. inexact access
- Y10S 707/99936: Pattern matching access
- Y10S 707/99943: Generating database or data structure, e.g. via user interface
- Y10S 707/99945: Object-oriented database structure processing
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y10S: TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS

## Abstract

A system and method of composing a query object for application against a database is provided. The method composes a selection clause for the query. Next, a criteria clause for the query is generated, with the criteria clause comprising input criteria related to the query, additional criteria specified against the query, and generated criteria based on a joint relationship. Next a source clause utilizing elements in the database accessed by the query is generated. A database traversal system and method is provided. The method identifies all tables directly accessible by each table and creates a data structure comprising an entry for each table. The entry comprises an identification field for each table and a link field identifying all tables directly accessible by each table. The data structure is traversed and an optimum path of the traversal paths utilizing data obtained from traversing the data structure is identified.

## Claims

### Claim 1

A method of composing a query for application against a database, said method comprising:
a) composing a selection clause for said query, said selection clause comprising a results set related to said query;
b) composing a criteria clause for said query, said criteria clause comprising input criteria related to said query and additional criteria specified against said query; and
c) composing a source clause utilizing elements in said database identified by said query.

### Claim 2 (depends on 1)

A method of composing a query for application against a database as claimed in claim 1, wherein said method further comprises the step of:
d) composing an ordering scheme for results of said query.

### Claim 3 (depends on 2)

A method of composing a query for application against a database as claimed in claim 2, wherein said method further comprises the step of:
e) composing a grouping scheme for results of said query.

### Claim 4 (depends on 1)

A method of composing a query for application against a database as claimed in claim 1, wherein said composing said criteria clause further comprises resolving joint relationships amongst said input criteria and said additional criteria.

### Claim 5 (depends on 4)

A method of composing a query for application against a database as claimed in claim 4, wherein said composing said criteria clause further comprises adding said joint relationships to said criteria clause.

### Claim 6 (depends on 5)

A method of composing a query for application against a database as claimed in claim 5, wherein said composing said source clause further comprises resolving a source after analyzing said selection clause and said criteria clause.

### Claim 7 (depends on 6)

A method of composing a query for application against a database as claimed in claim 6, wherein said query is produced in SQL format.

### Claim 8 (depends on 7)

A method of composing a query for application against a database as claimed in claim 7, wherein said method applies said query against said database and results of said query are provided to an output device.

### Claim 9

A query transaction system comprising:
a computer;
access to a database associated with said computer; and
a query processing program operating on said computer and generating a query for said database, said query processing program comprising:
a selection clause composing module for creating a selection clause for said query, said selection clause module producing a results set related to said query;
a criteria clause composing module for creating a criteria clause for said query, said criteria clause module processing input criteria related to said query and additional criteria specified against said query; and
a source clause composing module utilizing elements in said database identified by said query.

### Claim 10 (depends on 9)

A query transaction system as claimed in claim 9, wherein said query processing program further comprises an ordering module for results of said query.

### Claim 11 (depends on 9)

A query transaction system as claimed in claim 9, wherein said query processing program further comprises a grouping module for results of said query.

### Claim 12 (depends on 9)

A query transaction system as claimed in claim 9, wherein said criteria clause composing module further comprises a joint relationships resolving module associating said input criteria to said additional criteria.

### Claim 13 (depends on 12)

A query transaction system as claimed in claim 12, wherein said criteria clause composing module further comprises a module adding said joint relationships to said criteria clause.

### Claim 14 (depends on 13)

A query transaction system as claim in claim 13, wherein said source clause composing module resolves said source after analyzing said selection clause and said criteria clause.

### Claim 15

A computer readable information storage medium including a computer readable program encoded on said medium, said program comprising a method of composing a query for application against a database, said method comprising:
composing a selection clause for said query, said selection clause comprising a results set related to said query;
composing a criteria clause for said query, said criteria clause comprising input criteria related to said query and additional criteria specified against said query; and
composing a source clause utilizing elements in said database identified by said query.

### Claim 16 (depends on 15)

The computer readable information storage medium in claim 15, wherein said method of said computer program further comprises composing an ordering scheme for results of said query.

### Claim 17 (depends on 16)

The computer readable information storage medium in claim 16, wherein said method of said computer program further comprises composing a grouping scheme for results of said query.

### Claim 18 (depends on 15)

The computer readable information storage medium in claim 15, wherein said method of said computer program composes said criteria clause by resolving joint relationships amongst said input criteria and said additional criteria.

### Claim 19 (depends on 18)

The computer readable information storage medium in claim 18, wherein said method of said computer program composes said criteria clause by adding said joint relationships to said criteria clause.

### Claim 20 (depends on 19)

The computer readable information storage medium in claim 19, wherein said method of composing said source clause further comprises resolving a source related to said database after analyzing said selection clause and said criteria clause.

### Claim 21 (depends on 20)

The computer readable information storage medium in claim 20, wherein said query is applied against said database and results of said query are provided to an output device.

### Claim 22

A computer readable modulated carrier signal including a computer readable program encoded on said carrier signal, said program comprising a method of composing a query for application against a database, said method comprising:
composing a selection clause for said query, said selection clause comprising a results set related to said query;
composing a criteria clause for said query, said criteria clause comprising input criteria related to said query and additional criteria specified against said query; and
composing a source clause utilizing elements in said database identified by said query.

### Claim 23 (depends on 22)

The computer readable modulated carrier signal in claim 22, wherein said method of said computer program further comprises composing an ordering scheme for results of said query.

### Claim 24 (depends on 23)

The computer readable modulated carrier signal in claim 23, wherein said method of said computer program further comprises composing a grouping scheme for results of said query.

### Claim 25 (depends on 22)

The computer readable modulated carrier signal in claim 22, wherein said method of said computer program further comprises composing said criteria clause by resolving joint relationships amongst said input criteria and said additional criteria.

### Claim 26 (depends on 25)

The computer readable modulated carrier signal in claim 25, wherein said method of said computer program further comprises composing said criteria clause by adding said joint relationships to said criteria clause.

### Claim 27 (depends on 26)

The computer readable modulated carrier signal in claim 26, wherein said method of said computer program composes said source clause by resolving a source related to said database after analyzing said selection clause and said criteria clause.

### Claim 28 (depends on 22)

The computer readable modulated carrier signal in claim 22 wherein said signal is a transmission over a network.

### Claim 29

A method for evaluating traversal paths amongst a plurality of tables in a database, the database comprising at least a first table and a second table, the method comprising:
a) for each table of the plurality of tables:
a1) identifying all tables directly accessible by each table; and
a2) creating a data structure comprising an entry for each table, the entry comprising an identification field for each table and a link field identifying all tables directly accessible by each table;
b) for each entry for each table in the data structure, traversing the data structure to visit all other entries for all other tables in the data structure, if possible, using contents of the link field of each entry for each table; and
c) identifying an optimum path of the traversal paths utilizing data obtained from the traversing in step (b).

### Claim 30 (depends on 29)

The method for evaluating traversal paths in claim 29, wherein the identifying step (c) further comprising the step of tracking a number of hops taken to visit all other entries for all other tables in the data structure.

### Claim 31 (depends on 28)

The method for evaluating traversal paths in claim 28 wherein the data structure comprises a linked list.

### Claim 32 (depends on 31)

The method for evaluating traversal paths in claim 31 wherein said data structure is traversed in a breadth first manner.

### Claim 33 (depends on 31)

The method for evaluating traversal paths in claim 31 wherein said data structure is traversed in a depth first manner.

### Claim 34 (depends on 31)

The method for evaluating traversal paths in claim 31 wherein said optimum path is identified utilizing said number of hops taken to visit said all other entries.

### Claim 35 (depends on 34)

The method for evaluating traversal paths in claim 34 wherein for each table of the plurality of tables, the data structure further comprises a second link field identifying tables which directly access each table.

### Claim 36 (depends on 35)

The method for evaluating traversal paths in claim 35, wherein a value of the optimum path is provided to an output device.

### Claim 37

A database analysis system comprising:
a computer;
access to a database associated with said computer, said database comprising a plurality of tables, the plurality of tables including at least a first table and a second table; and
a database traversal program associated with said computer for evaluating traversal paths between said first table and said second table, said database traversal program comprising a method comprising:
for each table of said plurality of tables:
identifying all tables directly accessible by each table; and
creating a data structure comprising an entry for each table, said entry comprising an identification field and a link field identifying all tables directly accessible by each table;
for each entry for each table in said data structure, traversing said data structure to visit all other entries in said data structure, if possible, using contents of said link field of each entry for each table; and
identifying an optimum path of said traversal paths utilizing data obtained from traversing entries in said data structure.

### Claim 38 (depends on 37)

The database analysis system, as claimed in claim 37, wherein said method further comprises tracking a number of hops taken to visit said all other entries for all possible traversal routes to said all other entries.

### Claim 39 (depends on 38)

The database analysis system, as claimed in claim 38 wherein said optimum path is identified utilizing said number of hops taken to visit said all other entries.

### Claim 40 (depends on 37)

The database analysis system, as claimed in claim 37 wherein said data structure comprises a linked list.

### Claim 41 (depends on 37)

The database analysis system, as claimed in claim 37 wherein said data structure is traversed in a breadth first manner.

### Claim 42 (depends on 37)

The database analysis system, as claimed in claim 37 wherein said data structure is traversed in a depth first manner.

### Claim 43 (depends on 37)

The database analysis system, as claimed in claim 37 wherein for each table of said plurality of tables, said data structure further comprising a second link field identifying tables which directly access each table.

### Claim 44

A computer readable instruction storage medium including a database traversal program encoded on said medium for evaluating traversal paths in a database, said database comprising a plurality of tables, said database traversal program comprising a method, said method comprising:
for each table of said plurality of tables:
identifying all tables directly accessible by each table; and
creating a data structure comprising an entry for each table, said entry comprising an identification field and a link field identifying said all tables directly accessible by each table;
for each entry for each table in said data structure, traversing said data structure to visit all other entries in said data structure, if possible, using contents of said link field of each entry for each table; and
identifying an optimum path of said traversal paths utilizing data obtained from traversing entries in said data structure.

### Claim 45 (depends on 44)

The computer readable instruction storage medium in claim 44, wherein said method further comprising tracking a number of hops taken to visit said all other entries for all possible traversal route to said all other entries.

### Claim 46 (depends on 45)

The computer readable instruction storage medium in claim 45 wherein said data structure comprises a linked list.

### Claim 46 (depends on 46)

The computer readable instruction storage medium in claim 46 wherein said data structure is traversed in a breadth first manner.

### Claim 47 (depends on 46)

The computer readable instruction storage medium in claim 46 wherein said data structure is traversed in a depth first manner.

### Claim 48 (depends on 46)

The computer readable instruction storage medium in claim 46 wherein said optimum path is identified utilizing said number of hops taken to visit said all other entries.

### Claim 50 (depends on 46)

The computer readable instruction storage medium in claim 46 wherein for each table of said plurality of tables, said data structure further comprises a second link field identifying tables which directly access each table.
