Creating tables to track international sales

Suppose that you want to define tables to track the sales your company in different regions. You can create tables using the applicable currency distinct type as the column type for total sales revenue in a region.

Before you begin

For the list of privileges required to create tables, see the CREATE TABLE statement.

Procedure

To create tables to track international sales:

  1. Create currency-based distinct types.
  2. Issue the following CREATE TABLE statements:
         CREATE TABLE US_SALES 
           (PRODUCT_ITEM  INTEGER, 
            MONTH         INTEGER CHECK (MONTH BETWEEN 1 AND 12), 
            YEAR          INTEGER CHECK (YEAR > 1985), 
            TOTAL         US_DOLLAR) 
          
         CREATE TABLE CANADIAN_SALES 
           (PRODUCT_ITEM  INTEGER, 
            MONTH         INTEGER CHECK (MONTH BETWEEN 1 AND 12), 
            YEAR          INTEGER CHECK (YEAR > 1985), 
            TOTAL         CANADIAN_DOLLAR) 
         
         CREATE TABLE GERMAN_SALES
           (PRODUCT_ITEM  INTEGER, 
            MONTH         INTEGER CHECK (MONTH BETWEEN 1 AND 12), 
            YEAR          INTEGER CHECK (YEAR > 1985), 
            TOTAL         EURO)