Database Reference
In-Depth Information
LJQ
rightRows
denotes a set of rows of the right table.
LJQ
set
denotes a set which consist of
two elements. The
rst element is the
LJQ
rightRows
, and the second element is the
LJQ
leftRows
.
LJQ
rows
denotes a set of rows for a left CTT and right CTT.
LJQ
array
denotes
a two dimensional array that stores the retrieved rows.
5.5 Targeted Tables Query Algorithm
This algorithm combines the result-set of two, or more tables, whether they are CTTs,
VETs or a combination of both types of tables. It uses query
lters on multiple tables or
ltering of data based on the results of subqueries. These complex queries can be
executed by calling the function that executes this algorithm. Figure
5
shows an example
of a set of tables that have relationships between them. Table A (Root Table) and table C
have a Many-to-Many database relationship, while table B is a join table that construct
the relationship. Table C and table D have a One-to-Many relationship. Finally, Table D
and table E (Targeted Table) have a One-to-Many relationship. This algorithm
lters the
data in the Targeted Table E based on a number of query results obtained from table A to
table D.
Root Table
A
C
B
D
Targeted Table
E
Fig. 5.
Targeted Tables example
Denition 8 (Targeted Tables Query Algorithm).
TTQ
tables
denotes a set of CTTs
and/or VETs names.
TTQ
tablesSize
denotes the size of
TTQ
tables
.
TTQ
PK
denotes a set of
row matrix with 2 rows and n columns. The
rst row stores the column name of a table
primary key. The second row stores the value of a table primary key.
TTQ
select
denotes
a set of SELECT clauses, where each table in
TTQ
tables
may have a SELECT clause.
TTQ
where
denotes a set of WHERE clauses, where each table in
TTQ
tables
may have
a SELECT clause.
TTQ
type
denotes a table type of a table in
TTQ
tables
.
TTQ
tablesi
denotes
a current root table.
TTQ
tablesiĆ¾
1
denotes a current targeted table. Figure
6
shows an
example of current root table and current targeted table that this algorithm may reaches
during iterating the targeted table sequence list.
TTQ
relation
denotes a relationship
between two tables.
TTQ
PKi
denotes a primary key set for a current root table in
the
TTQ
tables
. This set has only primary key IDs without values that can be obtained
Search WWH ::
Custom Search