Download O2 ODBC User Manual

Transcript
Schema Translation : Primary Key Definition
.
CREATE SCHEMA document
CREATE TABLE Article( title LONGVARCHAR
date_title LONGVARCHAR PRIMARY KEY ( title )
FOREIGN KEY ( date_title ) REFERENCES Date )
CREATE TABLE Author( title LONGVARCHAR name LONGVARCHAR
address_institute_title LONGVARCHAR
address_email LONGVARCHAR
PRIMARY KEY ( title )
FOREIGN KEY ( address_institute_title )
REFERENCES Institute )
CREATE TABLE Date(
title LONGVARCHAR day INTEGER month INTEGER
year INTEGER PRIMARY KEY ( title ) )
CREATE TABLE Section(
title LONGVARCHAR title LONGVARCHAR ~
contents LONGVARCHAR PRIMARY KEY ( title ) )
CREATE TABLE Institute(
title LONGVARCHAR name LONGVARCHAR
country LONGVARCHAR PRIMARY KEY ( title ) )
CREATE TABLE Article_authors(
Article_title LONGVARCHAR
authors_title LONGVARCHAR
FOREIGN KEY ( Article_title )
REFERENCES Article
FOREIGN KEY ( authors_title )
REFERENCES Author )
CREATE TABLE Article_sections(
Article_title LONGVARCHAR
pos INTEGER
sections_title LONGVARCHAR
PRIMARY KEY ( Article_title, pos )
FOREIGN KEY ( Article_title )
REFERENCES Article
FOREIGN KEY ( sections_title )
REFERENCES Section )
Fi gu r e 4 .2 : Rel a t i on a l sch em a
document
Th e title m et h od or att r ibu t e is t h u s t r an slat ed by defau lt as a
pr im ar y k ey in t h e cor r espon din g t able bu t a differ en t at t r ibu te or
m et h od can be declar ed t o be u sed as a k ey in th e con figu r at ion file.
O2 ODBC User Man u al
35