28.06.2013 Views

Papers in PDF format

Papers in PDF format

Papers in PDF format

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

applications.<br />

Data and <strong>in</strong>dex def<strong>in</strong>ition for the tables Composer and Piece <strong>in</strong> SQL<br />

Tak<strong>in</strong>g a look at the SQL statements <strong>in</strong> the music database, we <strong>in</strong>stantly see possibibilities of automatic l<strong>in</strong>k generation.<br />

The table Composer is referenced by the table Piece; obviously, this reference can be used <strong>in</strong> generat<strong>in</strong>g hypertext l<strong>in</strong>k.<br />

Assum<strong>in</strong>g we translate each table entry <strong>in</strong>to a web page, one can easily imag<strong>in</strong>e how for each piece of music <strong>in</strong> the<br />

database a l<strong>in</strong>k can be added to the field ComposerID <strong>in</strong> table Piece. The SQL statement def<strong>in</strong>es this field as a foreign<br />

key which references the table Composer.<br />

Unfortunately, SQL statements for table creation are not normally available <strong>in</strong> legacy systems. However, the <strong>in</strong><strong>format</strong>ion<br />

is not lost: the RDBMS automatically manages the correspond<strong>in</strong>g structure. In the follow<strong>in</strong>g section we take a look at<br />

the way a RDBMS is stor<strong>in</strong>g meta-data about applications.<br />

4 The System Catalog<br />

RDBMS store meta <strong>in</strong><strong>format</strong>ion about applications <strong>in</strong> system catalog tables. The structure of all objects derived from the<br />

data def<strong>in</strong>ition language (DDL: SQL statements like CREATE TABLE, CREATE INDEX) <strong>in</strong> the user databases are<br />

described <strong>in</strong> the catalog tables. Sophisticated systems store other <strong>in</strong><strong>format</strong>ion as well, e. g. on permissions, statements<br />

embedded <strong>in</strong> application programs (DML). In [Pönighaus 1995] an analysis on the usage of SQL statements based on<br />

catalog data was performed; here we concentrate on DDL. The meta <strong>in</strong><strong>format</strong>ion conta<strong>in</strong>ed <strong>in</strong> the catalog tables is<br />

accessible via standard SQL statements. [Fig. 1b] shows an ER-model of a simplified system catalog (our meta base).<br />

System catalogs vary somewhat between database systems. In the follow<strong>in</strong>g we describe relevant parts of our system<br />

catalog here; most widely used database systems provide the <strong>in</strong><strong>format</strong>ion needed, although the correspond<strong>in</strong>g tables and<br />

fields would be named differently.<br />

Database:<br />

this table conta<strong>in</strong>s the names of the databases and their creators. In a typical RDBMS, a user can own more than<br />

one database.<br />

Tables:<br />

this table conta<strong>in</strong>s the names of the tables which form the application database. Entries <strong>in</strong> this table consist of<br />

table name, database name and creator name.<br />

Columns:<br />

this table describes the columns of all application tables. An additional Remarks field can be used for the web<br />

page generation if any text has been supplied by the table designers.<br />

Relationships:<br />

this table conta<strong>in</strong>s <strong>in</strong><strong>format</strong>ion on tables that are referenc<strong>in</strong>g other tables (or itself). It states the referenc<strong>in</strong>g table<br />

(Tbname), the table be<strong>in</strong>g referenced (Reftbname), and the name of the relationship.<br />

Foreignkeys:<br />

relationships to other tables are described here; for each relationship conta<strong>in</strong>ed <strong>in</strong> the catalog table Relationships,<br />

the columns <strong>in</strong>volved <strong>in</strong> the relationship are stated here.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!