20.4. Database Design

The first step was to design a database to use XML features as much as possible. We implemented a system to model book sales and reports. Listing 20.1 contains the core relational schema we used.

Listing 20.1. Relational Schema for the Book Sales and Reports System
 Relation Customer (Customer_no, Customer_name, Sex, Postal_code, Telephone, Email) Relation Customer_address (Customer_no, Address_type, Address, City, Sate, Country, Is_default) Relation Invoice (Invoice_no, Customer_no, Quantity, Invoice_amount, Invoice_date, Shipment_type, Shipment_date) Relation Invoice_item (Invoice_no, Item_no, quantity, Unit_price, Invoice_price, Discount) Relation Item (Item_no, Item_name, Catalog_type, Author, Publisher, Item_price) ...

Get XML Data Management: Native XML and XML-Enabled Database Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.