Appendix A describes all of the tables in the Aroma database, which consists of two schemas -- a simple star schema for retail sales information and a multistar schema for purchasing information.
Most of the examples in this article use the tables in the retail schema. The purchasing tables are used in a few examples that require a more flexible schema for adequate illustration.
You need to connect to a database before you can use SQL statements to query or manipulate data. The CONNECT statement associates a database connection with a username.
Find out from your instructor the database name that you need to be connected to. For this series, the database name is aromadb.
To connect to the aromadb database, type the following command in the DB2 command line processor:
CONNECT TO aromadb USER userid USING password |
Replace the userid and password with the user ID and password that you received from your instructor. If no user ID and password are required, simply use the following command:
CONNECT TO aromadb |
The following message tells you that you have made a successful connection:
Database Connection Information Database server = DB2/NT 9.0.0 SQL authorization ID = USERID Local database alias = AROMADB |
Once you are connected, you can start using the database.
Most of the examples in this guide are based on data from the basic Aroma database, which tracks daily retail sales in stores owned by the Aroma Coffee and Tea Company. The Figure 1 illustrates this basic schema.
Figure 1. Basic schema
The crow's-feet in this diagram indicate a one-to-many relationship between the two tables. For example, each distinct value in the Perkey column of the Period table can occur only once in that table but many times in the Sales table.
The following tables make up the basic Aroma database:
| Table | Description |
|---|---|
| Period | Defines time intervals such as days, months, and years. |
| Class | Defines classes of products sold at retail stores. |
| Product | Defines individual products sold at retail stores, including bulk and packaged coffee and tea, and coffee machines. |
| Market | Defines the geographical markets of the business. |
| Store | Defines individual retail stores owned and operated by the Aroma Coffee and Tea Company. |
| Promotion | Defines the types, durations, and values of promotions run on different products. |
| Sales | Contains the sales figures for Aroma products during time periods at various stores. |
| Gold | Contains customers who have purchased promotion cards. |
The Period, Class, Product, Market, Store, Promotion, and Gold tables are examples of typical business dimensions. They are small and contain descriptive data that is familiar to users.
The Sales table is a good example of a fact table. It contains thousands of rows, and its largely additive information is accessed in queries by joins to the dimension tables it references.
Sample data from the Class and Product tables
SELECT * FROM aroma.class; |
Result
| Classkey | Class_Type | Class_Desc |
|---|---|---|
| 1 | Bulk_beans | Bulk coffee products |
| 2 | Bulk_tea | Bulk tea products |
| 3 | Bulk_spice | Bulk spices |
| 4 | Pkg_coffee | Individually packaged coffee products |
| 5 | Pkg_tea | Individually packaged tea products |
| 6 | Pkg_spice | Individually packaged spice products |
| 7 | Hardware | Coffee mugs, teapots, spice jars, espresso machines |
| 8 | Gifts | Samplers, gift boxes, and baskets |
| 12 | Clothing | T-shirts and caps |
SELECT * FROM aroma.product; |
Result
| Classkey | Prodkey | Prod_Name | Pkg_Type |
|---|---|---|---|
| 1 | 0 | Veracruzano | No pkg |
| 1 | 1 | Xalapa Lapa | No pkg |
| 1 | 10 | Colombiano | No pkg |
| 1 | 11 | Expresso XO | No pkg |
| 1 | 12 | La Antigua | No pkg |
| 1 | 20 | Lotta Latte | No pkg |
| 1 | 21 | Cafe Au Lait | No pkg |
| 1 | 22 | NA Lite | No pkg |
| 1 | 30 | Aroma Roma | No pkg |
| 1 | 31 | Demitasse Ms | No pkg |
| 2 | 0 | Darjeeling Number 1 | No pkg |
| 2 | 1 | Darjeeling Special | No pkg |
| 2 | 10 | Assam Grade A | No pkg |
| ... | |||
The Product table describes the products defined in the Aroma database. The Class table describes the classes to which those products belong.
Column descriptions: Class table
| Column Name | Contents |
|---|---|
| classkey | Integer that identifies exactly one row in the Class table. Classkey is the primary key. |
| class_type | Character string that identifies a group of products. |
| class_desc | Character string that describes a group of products. |
Column Descriptions: Product table
| Column Name | Contents |
|---|---|
| classkey | Foreign-key reference to the Class table. |
| prodkey | Integer that combines with the Classkey value to identify exactly one row in the Product table. Classkey/prodkey is a two-column primary key. |
| prod_name | Character string that identifies a product. The database contains 59 products. A fully populated database would have many more. Although some Aroma products have the same name, they belong to different classes and have different package types. |
| pkg_type | Character string that identifies the type of packaging for each product. |
Sample data from the store and market tables
SELECT * FROM aroma.market; |
Result
| Mktkey | HQ_City | HQ_State | District | Region |
|---|---|---|---|---|
| 1 | Atlanta | GA | Atlanta | South |
| 2 | Miami | FL | Atlanta | South |
| 3 | New Orleans | LA | New Orleans | South |
| 4 | Houston | TX | New Orleans | South |
| 5 | New York | NY | New York | North |
| ... | ||||
SELECT * FROM aroma.store; |
Result
| Storekey | Mktkey | Store_Type | Store_Name | Street | City | State | Zip |
|---|---|---|---|---|---|---|---|
| 1 | 14 | Small | Roasters, Los Gatos | 1234 University Ave | Los Gatos | CA | 95032 |
| 2 | 14 | Large | San Jose Roasting Company | 5678 Bascom Ave | San Jose | CA | 95156 |
| 3 | 14 | Medium | Cupertino Coffee Supply | 987 DeAnza Blvd | Cupertino | CA | 97865 |
| 4 | 3 | Medium | Moulin Rouge Roasting | 898 Main Street | New Orleans | LA | 70125 |
| 5 | 10 | Small | Moon Pennies | 98675 University Ave | Detroit | MI | 48209 |
| 6 | 9 | Small | The Coffee Club | 9865 Lakeshore Blvd | Chicago | IL | 06060 |
| ... | |||||||
The Store table defines the Aroma Coffee and Tea Company stores. The Market table describes the U.S. markets to which each store belongs. Each market is identified by a major metropolitan city. The Market table is an outboard table, like the Class table.
Column descriptions: Market table
| Column Name | Contents |
|---|---|
| Mktkey | Integer that identifies exactly one row in the Market table. Mktkey is the primary key. |
| hq_city | Character string that identifies a city. The Market table defines 17 cities. A fully populated database could have thousands. |
| State | Character string that identifies a state. |
| District | Character string that identifies a district based on a major metropolitan city. A global database would contain countries and nations or other geographic dimensions. |
| Region | Character string that identifies a region. The Market table defines only four regions for the entire United States. A comprehensive database would include numerous regions and probably more districts within a region. |
Column descriptions: Store table
| Column Name | Contents |
|---|---|
| storekey | Integer that identifies exactly one row in the Store table. Storekey is the primary key. |
| Mktkey | Foreign-key reference to the Market table. |
| store_type | Character string that identifies stores by size. |
| store_name | Character string that identifies a store by name. |
| street, city, state, zip | Columns that identify the address of each store. |
Sample data from the Period table
SELECT * FROM aroma.period; |
Result
| Perkey | Date | Day | Week | Month | Qtr | Year |
|---|---|---|---|---|---|---|
| 1 | 2004-01-01 | TH | 1 | JAN | Q1_04 | 2004 |
| 2 | 2004-01-02 | FR | 1 | JAN | Q1_04 | 2004 |
| 3 | 2004-01-03 | SA | 1 | JAN | Q1_04 | 2004 |
| 4 | 2004-01-04 | SU | 2 | JAN | Q1_04 | 2004 |
| 5 | 2004-01-05 | MO | 2 | JAN | Q1_04 | 2004 |
| 6 | 2004-01-06 | TU | 2 | JAN | Q1_04 | 2004 |
| 7 | 2004-01-07 | WE | 2 | JAN | Q1_04 | 2004 |
| 8 | 2004-01-08 | TH | 2 | JAN | Q1_04 | 2004 |
| 9 | 2004-01-09 | FR | 2 | JAN | Q1_04 | 2004 |
| 10 | 2004-01-10 | SA | 2 | JAN | Q1_04 | 2004 |
| 11 | 2004-01-11 | SU | 3 | JAN | Q1_04 | 2004 |
| 12 | 2004-01-12 | MO | 3 | JAN | Q1_04 | 2004 |
| 13 | 2004-01-13 | TU | 3 | JAN | Q1_04 | 2004 |
| 14 | 2004-01-14 | WE | 3 | JAN | Q1_04 | 2004 |
| 15 | 2004-01-15 | TH | 3 | JAN | Q1_04 | 2004 |
| 16 | 2004-01-16 | FR | 3 | JAN | Q1_04 | 2004 |
| 17 | 2004-01-17 | SA | 3 | JAN | Q1_04 | 2004 |
| 18 | 2004-01-18 | SU | 4 | JAN | Q1_04 | 2004 |
| 19 | 2004-01-19 | MO | 4 | JAN | Q1_04 | 2004 |
| 20 | 2004-01-20 | TU | 4 | JAN | Q1_04 | 2004 |
| ... | ||||||
The Period table defines daily, weekly, monthly, quarterly, and yearly time periods for 2004, 2005, and the first quarter of 2006.
Column descriptions
| Column Name | Contents |
|---|---|
| Perkey | Integer that identifies exactly one row in the Period table. Perkey is the primary key. |
| Date | Date value that identifies each day from January 1, 1998 through March 31, 2000. |
| Day | Character-string abbreviation of the day of the week. |
| Week | Integer that identifies each week of each year by number (1 through 53, each new week starting on a Sunday). |
| Month | Character-string abbreviation of the name of each month. |
| Qtr | Character string that uniquely identifies each quarter (for example, Q1_98, Q3_99). |
| Year | Integer that identifies the year. |
Sample data from the Promotion table
SELECT * FROM aroma.promotion; |
Result
| Promokey | Promo_Type | Promo_Desc | Value | Start_Date | End_Date |
|---|---|---|---|---|---|
| 0 | 1 | No promotion | 0.00 | 9999-01-01 | 9999-01-01 |
| 1 | 100 | Aroma catalog coupon | 1.00 | 2004-01-01 | 2004-01-31 |
| 2 | 100 | Aroma catalog coupon | 1.00 | 2004-02-01 | 2004-02-29 |
| 3 | 100 | Aroma catalog coupon | 1.00 | 2004-03-01 | 2004-03-31 |
| 4 | 100 | Aroma catalog coupon | 1.00 | 2004-04-01 | 2004-04-30 |
| 5 | 100 | Aroma catalog coupon | 1.00 | 2004-05-01 | 2004-05-31 |
| 6 | 100 | Aroma catalog coupon | 1.00 | 2004-06-01 | 2004-06-30 |
| 7 | 100 | Aroma catalog coupon | 1.00 | 2004-07-01 | 2004-07-31 |
| 8 | 100 | Aroma catalog coupon | 1.00 | 2004-08-01 | 2004-08-31 |
| 9 | 100 | Aroma catalog coupon | 1.00 | 2004-09-01 | 2004-09-30 |
| 10 | 100 | Aroma catalog coupon | 1.00 | 2004-10-01 | 2004-10-31 |
| 11 | 100 | Aroma catalog coupon | 1.00 | 2004-11-01 | 2004-11-30 |
| 12 | 100 | Aroma catalog coupon | 1.00 | 2004-12-01 | 2004-12-31 |
| 13 | 100 | Aroma catalog coupon | 1.00 | 2005-01-01 | 2005-01-31 |
| 14 | 100 | Aroma catalog coupon | 1.00 | 2005-02-01 | 2005-02-28 |
| 15 | 100 | Aroma catalog coupon | 1.00 | 2005-03-01 | 2005-03-31 |
| 16 | 100 | Aroma catalog coupon | 1.00 | 2005-04-01 | 2005-04-30 |
| 17 | 100 | Aroma catalog coupon | 1.00 | 2005-05-01 | 2005-05-31 |
| 18 | 100 | Aroma catalog coupon | 1.00 | 2005-06-01 | 2005-06-30 |
| 19 | 100 | Aroma catalog coupon | 1.00 | 2005-07-01 | 2005-07-31 |
| 20 | 100 | Aroma catalog coupon | 1.00 | 2005-08-01 | 2005-08-31 |
| ... | |||||
The Promotion table is a dimension table that describes promotions that are run on different products during different time periods. Promotion tables are sometimes referred to as condition tables because they indicate the conditions under which goods are sold.
Column descriptions
| Column Name | Contents |
|---|---|
| promokey | Integer that identifies exactly one row in the Promotion table. Promokey is the primary key. |
| promo_type | Integer that identifies the promotion by number (or code). |
| promo_desc | Character string that describes the promotion type. |
| value | Decimal number that represents the dollar value of the promotion, such as a price reduction or the value of a coupon. |
| start_date, end_date | Date values that indicate when each promotion begins and ends. |
Sample data from the Sales table
SELECT * FROM aroma.sales; |
Result
| Perkey | Classkey | Prodkey | Storekey | Promokey | Quantity | Dollars |
|---|---|---|---|---|---|---|
| 2 | 2 | 0 | 1 | 116 | 8 | 34.00 |
| 2 | 4 | 12 | 1 | 116 | 9 | 60.75 |
| 2 | 1 | 11 | 1 | 116 | 40 | 270.00 |
| 2 | 2 | 30 | 1 | 116 | 16 | 36.00 |
| 2 | 5 | 22 | 1 | 116 | 11 | 30.25 |
| 2 | 1 | 30 | 1 | 116 | 30 | 187.50 |
| 2 | 1 | 10 | 1 | 116 | 25 | 143.75 |
| 2 | 4 | 10 | 2 | 0 | 12 | 87.00 |
| 2 | 4 | 11 | 2 | 0 | 14 | 115.50 |
| 2 | 2 | 22 | 2 | 0 | 18 | 58.50 |
| 2 | 4 | 0 | 2 | 0 | 17 | 136.00 |
| 2 | 5 | 0 | 2 | 0 | 13 | 74.75 |
| 2 | 4 | 30 | 2 | 0 | 14 | 101.50 |
| 2 | 2 | 10 | 2 | 0 | 18 | 63.00 |
| 2 | 1 | 22 | 3 | 0 | 11 | 99.00 |
| 2 | 6 | 46 | 3 | 0 | 6 | 36.00 |
| 2 | 5 | 12 | 3 | 0 | 10 | 40.00 |
| 2 | 1 | 11 | 3 | 0 | 36 | 279.00 |
| 2 | 5 | 1 | 3 | 0 | 11 | 132.00 |
| 2 | 5 | 10 | 3 | 0 | 12 | 48.00 |
| ... | ||||||
Multipart primary key
The Sales table contains a multipart primary key: Each of its five columns is a foreign-key reference to the primary key of another table:
perkey, classkey, prodkey, storekey, promokey |
This primary key links the Sales table data to the Period, Product, Store, and Promotion dimensions.
Joins with the Sales table are shown in examples throughout this tutorial series.
Column descriptions
| Column Name | Contents |
|---|---|
| perkey | Foreign-key reference to the Period table. |
| classkey | Foreign-key reference to the Class table. |
| prodkey | Foreign-key reference to the Product table. |
| storekey | Foreign-key reference to the Store table. |
| promokey | Foreign-key reference to the Promotion table. |
| quantity | Integer that represents the total quantity sold (per day). |
| dollars | Decimal number that represents dollar sales figures (per day). |
Sample data from the Gold table
Note: Participants will not find this table in the Aroma database upon initialization. It is meant to be created by participants in Part 6 of this series, Data Definition Language and Control Language (developerWorks, August 2006).
The following results table displays the table as it would be after "The INSERT Statement" section of Part 6.
SELECT * FROM aroma.gold; |
Result
| Card_id | Storekey | Fname | Lname | Status | |
|---|---|---|---|---|---|
| 1 | 1 | Ada | Alexander | coffee_lover@hotmail.com | Active |
| 2 | 1 | Ben | Bowman | mmmcoffee@yahoo.com | Active |
| 3 | 1 | Cynthia | Chen | iheartcoffee@gmail.com | Active |
| 4 | 1 | David | Doyle | coffee_maniac@msn.com | Active |
| 5 | 1 | Emily | Enright | cupAday@hotmail.com | Active |
| 6 | 1 | Frank | Freeman | coffee_addict@gmail.com | Active |
The Gold table contains information about customers who have purchased a promotion card.
Column descriptions
| Column Name | Contents |
|---|---|
| card_id | SMALLINT that identifies the customer with an unique card number. |
| storekey | Foreign-key reference to the Store table. |
| fname | Character string that stores the first name of the customer. |
| lname | Character string that stores the last name of the customer. |
| Character string that stores the email of the customer. | |
| status | Character string that stores the status of the customer. |
Purchasing schema of the Aroma database
A few of the examples in this tutorial series are based on tables used to track product orders that the Aroma Coffee and Tea Company receives from its suppliers. This purchasing schema uses the same Product, Class, and Period dimensions as the retail schema but has two dimensions of its own: Deal and Supplier. The Line_Items and Orders tables both contain facts, but the Orders table can also be queried as a dimension table referenced by the Line_Items table.
Figure 2 illustrates the tables in the purchasing schema.
Figure 2. Tables in purchasing schema
The primary keys of the Line_Items and Orders tables do not match the set of their respective dimension-table foreign keys. Any given combination of dimension table primary keys can point to more than one row in these fact tables. This type of table is known as a multistar fact table or data list.
For example, multiple order numbers in the Orders table can refer to the same set of Supplier, Deal, and Period characteristics:
| Order_No | Perkey | Supkey | Dealkey |
|---|---|---|---|
| 3699 | 817 | 1007 | 0 |
| 3700 | 817 | 1007 | 0 |
The purchasing schema contains similar kinds of facts to those stored in the Sales table, prices, and quantities. The prices are dollar values representing amounts paid to suppliers for whole orders or specific line items within orders. The quantities represent units of a product ordered.
You can use this schema to ask interesting questions about the purchasing history of the Aroma Coffee and Tea Company, for example, which suppliers give the best deal on which products, or which suppliers have the best record for closing orders.
The Aroma Coffee and Tea Company sells the same products throughout its stores as it orders through its suppliers. Therefore, you can write queries that span both schemas to compare what was ordered with what was sold or to calculate simple profit margins.
The following tables make up the purchasing schema of the Aroma database:
| Period | Defines time intervals such as days, months, and years. |
| Class | Defines classes of products, both sold at retail stores and ordered from suppliers. |
| Product | Defines individual products, both sold at retail stores and ordered from suppliers. |
| Supplier | Defines the suppliers of products ordered by the Aroma Coffee and Tea Company. |
| Deal | Defines the discount deals applied to orders by suppliers. |
| Line_Items | Contains the line item detail information for product orders, including the price and quantity of each item on each order. |
| Orders | Contains information about product orders, such as the full price of each order and the types of products ordered. |
The Supplier and Deal tables are exclusive to the purchasing schema and are referenced by the Orders table.
|
| Tip: The purchasing schema contains data for the first quarter of 2000 only. |
Sample data from the Supplier and Deal tables
SELECT * FROM aroma.supplier; |
Result
| Supkey | Type | Name | Street | City | State | Zip |
|---|---|---|---|---|---|---|
| 1001 | Coffee/tea | CB Imports | 100 Church Street | Mountain View | CA | 94001 |
| 1002 | Tea | Tea Makers, Inc. | 1555 Hicks Rd. | San Jose | CA | 95124 |
| ... | ||||||
SELECT * FROM aroma.deal; |
Result
| Dealkey | Deal_Type | Deal_Desc | Discount |
|---|---|---|---|
| 0 | 1000 | No deal | 0.00 |
| 1 | 100 | Orders over $10,000 | 100.00 |
| 2 | 100 | Orders over $20,000 | 500.00 |
| 3 | 100 | Supplier catalog coupon | 50.00 |
| 4 | 100 | Supplier catalog coupon | 100.00 |
| 37 | 200 | Supplier coffee special | 75.00 |
| 38 | 200 | Supplier coffee special | 50.00 |
| 39 | 200 | Supplier tea special | 40.00 |
| 40 | 200 | Supplier tea special | 20.00 |
Column descriptions: Supplier table
| Column Name | Contents |
|---|---|
| supkey | Integer that identifies exactly one row in the Supplier table. Supkey is the primary key. |
| type | Character string that indicates the type of products supplied. |
| name | Character string that identifies the supplier by name. |
| street, city, state, zip | Columns that identify the address of the supplier. |
Column descriptions: Deal table
| Column Name | Contents |
|---|---|
| dealkey | Integer that identifies exactly one row in the Deal table. Dealkey is the primary key. |
| deal_type | Integer that identifies the type of deal (a code number). |
| deal_desc | Character string that describes the type of deal. |
| discount | Decimal value that indicates the dollar amount of the deal applied to an order. |
The purchasing schema shares the Period, Product, and Class tables with the retail schema.
As well as querying the retail and purchasing schemas independently, you can pose some interesting questions that involve tables from both schemas. For example, you can join the Sales and Line_Items tables to compare quantities of products ordered with quantities of products sold. A query like this uses the shared dimensions to constrain products and periods.
Sample data from the Orders and Line_Items tables
SELECT * FROM aroma.orders; |
Result
| Order_No | Perkey | Supkey | Dealkey | Order_Type | Order_Desc | Close_Date | Price |
|---|---|---|---|---|---|---|---|
| 3600 | 731 | 1001 | 37 | Coffee | Whole coffee b | 2006-01-07 | 1200.46 |
| 3601 | 732 | 1001 | 37 | Coffee | Whole coffee b | 2006-01-07 | 1535.94 |
| 3602 | 733 | 1001 | 0 | Tea | Loose tea, bul | 2006-01-07 | 780.00 |
| 3603 | 740 | 1001 | 39 | Tea | Loose tea, bul | 2006-01-21 | 956.45 |
| 3604 | 744 | 1005 | 0 | Spice | Pre-packed spi | 2006-01-16 | 800.66 |
| 3605 | 768 | 1003 | 2 | Coffee | Whole-bean and | 2006-02-12 | 25100.00 |
| 3606 | 775 | 1003 | 2 | Coffee | Whole-bean and | 2006-02-19 | 25100.00 |
| 3607 | 782 | 1003 | 2 | Coffee | Whole-bean and | 2006-02-25 | 25100.00 |
| 3608 | 789 | 1003 | 2 | Coffee | Whole-bean and | 2006-03-03 | 30250.00 |
| 3609 | 796 | 1003 | 2 | Coffee | Whole-bean and | 2006-03-15 | 25100.00 |
| ... | |||||||
SELECT * FROM aroma.line_items; |
Result
| Order_No | Line_Item | Perkey | Classkey | Prodkey | Receive_Date | Qty | Price |
|---|---|---|---|---|---|---|---|
| 3600 | 1 | 731 | 1 | 1 | 2006-01-07 | 40 | 180.46 |
| 3600 | 2 | 731 | 2 | 10 | 2006-01-07 | 50 | 300.00 |
| 3600 | 3 | 731 | 2 | 11 | 2006-01-07 | 80 | 240.00 |
| 3600 | 4 | 731 | 2 | 12 | 2006-01-07 | 150 | 240.00 |
| 3600 | 5 | 731 | 1 | 20 | 2006-01-07 | 60 | 240.00 |
| 3601 | 1 | 732 | 1 | 0 | 2006-01-07 | 60 | 240.00 |
| 3601 | 2 | 732 | 1 | 1 | 2006-01-07 | 60 | 240.00 |
| 3601 | 3 | 732 | 1 | 10 | 2006-01-07 | 60 | 240.00 |
| 3601 | 4 | 732 | 1 | 11 | 2006-01-07 | 60 | 240.00 |
| 3601 | 5 | 732 | 1 | 12 | 2006-01-07 | 60 | 240.00 |
| 3601 | 6 | 732 | 1 | 31 | 2006-01-07 | 70 | 335.94 |
| 3602 | 1 | 733 | 2 | 0 | 2006-01-08 | 70 | 130.00 |
| 3602 | 2 | 733 | 2 | 1 | 2006-01-08 | 70 | 130.00 |
| ... | |||||||
The Orders and Line_Items tables
The Orders and Line_Items tables contain the purchasing facts.
Column descriptions: Orders table
| Column Name | Contents |
|---|---|
| order_no | Integer that identifies exactly one row in the Orders table. Order_No is the primary key. |
| perkey | Foreign-key reference to the Period table. |
| supkey | Foreign-key reference to the Supplier table. |
| dealkey | Foreign-key reference to the Deal table. |
| order_type | Character string that defines the types of products on the order. |
| order_desc | Character string that describes the type of order. |
| close_date | Date value that identifies when the order was completed or closed. |
| price | Decimal value that indicates the full cost of the order. |
Column descriptions: Line_Items table
| Column Name | Contents |
|---|---|
| order_no | Integer that identifies exactly one row in the Orders table. Order_No is the primary key. |
| line_item | Integer that identifies each item listed on the order by number. |
| perkey | Foreign-key reference to the Period table. |
| classkey | Foreign-key reference to the Class table. |
| prodkey | Foreign-key reference to the Product table. |
| receive_date | Date value that identifies when the line item was received. |
| quantity | Integer that indicates the quantity of products ordered for each line item. |
| price | Decimal value that indicates the cost of the line item. |
Learn
- "DB2 XML evaluation guide" (developerWorks, June 2006): Read a step-by-step tutorial introducing the reader to the DB2 Viper data server on Windows platforms using the XML storage and searching (SQL/XML, XQuery) capabilities available to support next-generation applications.
- "Get off to a fast start with DB2 Viper" (developerWorks, March 2006): Learn how to create database objects for managing your XML data and how to populate your DB2 database with XML data.
- "Query DB2 XML data with XQuery" (developerWorks, April 2006): Learn how to query data stored in XML columns using XQuery.
- "Query DB2 XML data with SQL" (developerWorks, March 2006): Learn how to query data stored in XML columns using SQL and SQL/XML.
- "IBM Systems Journal": Celebrate 10 years of XML.
- "SQL Reference, Vol 1": Find information about relational database concepts, language elements, functions, and the forms of queries.
- "SQL Reference, Vol 2": Find information about the syntax and semantics of SQL statements.
for additional information.
- Refer to the
IBM DB2 Database for Linux, UNIX, and Windows Information Center for troubleshooting help.
- Visit the DB2 XML technical enablement space for links to more than 25 papers on DB2 XML capabilities.
-
developerWorks Information Management zone: Learn more about DB2. Find technical documentation, how-to articles, education, downloads, product information, and more.
-
Stay current with developerWorks
technical events and webcasts.
Get products and technologies
- Download DB2 Express-C, a no-charge data server for use in development and deployment of applications .
-
Build your next development project with
IBM
trial software, available for download directly from developerWorks.
Discuss
- Participate in the discussion forum.
- Visit the DB2 9 On-line Support Forum.
-
Participate in developerWorks blogs and get involved in the developerWorks community.

Pat Moffatt is the Information Management Program Manager for the IBM Academic Initiative. Through the Academic Initiative program, she ensures that appropriate Information Management resources are made available to help faculty integrate Information Management software into their curriculum. To learn more about this program, visit www.ibm.com/university/data.

Bruce Creighton is a Skills Segment Planner in the Information Management Education Planning and Development department. In this role, he plans investment in educational content and balances the investment between areas where IBM can attain revenue and those where the requirement for skills development are important enough to provide free education.

Jessica Cao is an Arts and Science and Computer Science student at McMaster University. She expects to complete her combined honours degree in April 2009. Jessica is working in IBM Toronto lab's DB2 Information Management Skills Channel Planning and Enablement Program to take advantage of her interest in programming, editing, and writing.
Comments (Undergoing maintenance)





