170 likes | 269 Views
Database Project Group 7. Done by: Zhong Liang Sarah Ong Janice Chow Francis Pang. TOPICS. Introduction Implementation Limitation of system Conclusion . INTRODUCTION. XML is gaining popularity Increasing demand for the use of XML databases
E N D
Database Project Group 7 Done by: Zhong Liang Sarah Ong Janice Chow Francis Pang
TOPICS • Introduction • Implementation • Limitation of system • Conclusion
INTRODUCTION • XML is gaining popularity • Increasing demand for the use of XML databases • Need for converting relational databases to XML databases and schemas. • CASE tool to translate relational databases into XML databases.
IMPLEMENTATION • Use the ORA-SS model in our implementation. • Implemented in Java • Store our database using MySQL. Steps to implementation: • Relational Database (RDB) To Entity-Relationship Diagram (ERD) • ERD TO ORA-SS • ORA-SS TO XML Schema and Data
Step 1 : Relational Database (RDB) To Entity-Relationship Diagram (ERD)
Step 1 : Relational Database (RDB) To Entity-Relationship Diagram (ERD)
Demo : RDB CREATE TABLE Person( PersonNumber INT NOT NULL PRIMARY KEY, PersonName VARCHAR(255)) CREATE TABLE House( PostalCode CHAR(6) NOT NULL PRIMARY KEY, HouseType VARCHAR(255) NOT NULL) CREATE TABLE Livein( PostalCode CHAR(6) NOT NULL, PersonNumber INTNOT NULL, Rental INT, RelationshipWithOwner VARCHAR(255), PRIMARY KEY (PostalCode, PersonNumber), FOREIGN KEY (PostalCode) REFERENCES House(PostalCode), FOREIGN KEY (PersonNumber) REFERENCES Person(PersonNumber)) CREATE TABLE Pet ( PetNumber VARCHAR(2) NOT NULL, PetDied BOOLEAN, PRIMARY KEY (PetNumber)) CREATE TABLE Own( PostalCode CHAR(6) NOT NULL, PersonNumber INT NOT NULL, SinceWhen DATE, TitleDeedNumber VARCHAR(255) NOT NULL, PRIMARY KEY (PostalCode, PersonNumber), FOREIGN KEY (PostalCode) REFERENCES House(PostalCode), FOREIGN KEY (PersonNumber) REFERENCES Person(PersonNumber)) CREATE TABLE Takecare( PersonNumber INT NOT NULL, PetNumber VARCHAR(2) NOT NULL, PRIMARY KEY (PersonNumber, PetNumber), FOREIGN KEY (PersonNumber) REFERENCES Person(PersonNumber), FOREIGN KEY (PetNumber) REFERENCES Pet(PetNumber));
Cycle • We assume that a cycle always takes one of these forms:
Step 2 : ERD TO ORA-SS • Start from a user specified root node, then traverse ERD to construct a hierachical model
Step 2 : ERD TO ORASS Price Price * Price is an attribute of SPJ
Step 3 : ORASS TO XML Schema and Data Results From Demo
Assumption • A foreign key must be referenced to a primary key. • The database given should be at least in 1NF • The user does not input an empty database • The database has relations which are interconnected through foreign keys
Summary of Features Besides the basic entities and relationships, our translator is able to handle the following scenarios: • ERD with cycle • N-ary relationship • Weak entity constraint • Multi-valued attribute
LIMITATION OF SYSTEM • Recursive Relationships • ISA Relationship • Aggregation