Description of the illustration customer-orders-schema
This figure shows the relational tables in schema CO and the columns in each table, as well as dependencies between the tables.
The table products
has the following attributes:
- Columns:
product_id
(primary key),product_name
,unit_price
,product_details
,product_image
,image_mime_type
,image_charset
,image_filename
,image_last_updated
. - Relationships:
- Column
product_id
relates each row of the tableproducts
to none or more rows ofproduct_id
in theorder_items
table.
- Column
The customers
table has the following attributes:
- Columns:
customer_id
(primary key),email_address
,full_name
- Relationships:
- Column
customer_id
relates each row of the tablecustomers
to none or more rows ofcustomer_id
in theorders
table.
- Column
The order_items
table has the following attributes:
- Columns:
order_id
andline_item_id
(a composite primary key),product_id
,unit_price
,quantity
. The table also has a composite unique key onorder_id
andproduct_id
. - Relationships:
- Column
product_id
relates each row of the tableorder_items
to exactly one value ofproduct_id
in theproducts
table. - Each
order_items
record is associated with a record inorders
table through theorder_id.
- Column
The orders
table has the following attributes:
- Columns:
order_id
(primary key),order_datetime
,customer_id
,order_status
,store_id
. - Relationships:
- Column
order_id
relates each row of the tableorders
to none or more rows oforder_id
in theorder_items
table. - Column
customer_id
relates none or more rows of the tableorders
to the corresponding values in thecustomer_id
column of the tablecustomers
. - Column
store_id
relates none or more rows of the tableorders
to the corresponding values in thestore_id
column of the tablestores
.
- Column
The stores
table has the following attributes:
- Columns:
store_id
(primary key),store_name
,web_address
,physical_address
,latitude
,longitude
,logo
,logo_mime_type
,logo_charset
,logo_filename
,logo_last_updated
. - Relationships:
- Column
store_id
relates each row of the tablestores
to none or more rows ofstore_id
in thecustomers
table.
- Column