Dumped on 2008-04-01
| F-Key | Name | Type | Description |
|---|---|---|---|
| col1 | integer |
| F-Key | Name | Type | Description |
|---|---|---|---|
| col1 | integer | ||
| cola | integer | ||
| colb | integer | ||
| col1b | integer |
| F-Key | Name | Type | Description |
|---|---|---|---|
| cola | integer |
| F-Key | Name | Type | Description |
|---|---|---|---|
| cola | integer | ||
| colb | integer |
This schema stores a list of products and information about the product
| F-Key | Name | Type | Description |
|---|---|---|---|
| product_id | serial | PRIMARY KEY | |
| product_code | text | UNIQUE NOT NULL | |
| product_description | text |
| Name | Constraint |
|---|---|
| product_product_code_check | CHECK ((product_code = upper(product_code))) |
Tables referencing this one via Foreign Key Constraints:
Worker function appropriate for products
SELECT $1 + $1;
Store inventory
| F-Key | Name | Type | Description |
|---|---|---|---|
| store.store.store_id | store_id | integer | PRIMARY KEY |
| product.product.product_id | product_id | integer | PRIMARY KEY |
| quantity | integer | NOT NULL |
| Name | Constraint |
|---|---|
| inventory_quantity_check | CHECK ((quantity > 0)) |
| F-Key | Name | Type | Description |
|---|---|---|---|
| store_id | serial | PRIMARY KEY | |
| store_code | text | UNIQUE NOT NULL | |
| store_description | text |
| Name | Constraint |
|---|---|
| store_store_code_check | CHECK ((store_code = upper(store_code))) |
Tables referencing this one via Foreign Key Constraints:
A list of warehouses and information on warehouses
Warehouse inventory
| F-Key | Name | Type | Description |
|---|---|---|---|
| warehouse.warehouse.warehouse_id | warehouse_id | integer | PRIMARY KEY |
| product.product.product_id | product_id | integer | PRIMARY KEY |
| quantity | integer | NOT NULL |
| Name | Constraint |
|---|---|
| inventory_quantity_check | CHECK ((quantity > 0)) |
| F-Key | Name | Type | Description |
|---|---|---|---|
| product_id | integer | ||
| product_code | text | ||
| product_description | text |
SELECT DISTINCT product.product_id , product.product_code , product.product_description FROM (warehouse.inventory JOIN product.product USING (product_id) ) ORDER BY product.product_id , product.product_code , product.product_description;
| F-Key | Name | Type | Description |
|---|---|---|---|
| warehouse_id | serial | PRIMARY KEY | |
| warehouse_code | text |
UNIQUE NOT NULL Internal code which represents warehouses for invoice purposes |
|
| warehouse_manager | text |
NOT NULL Name of Warehouse Manager |
|
| warehouse_supervisor | text |
UNIQUE Supervisors name for a warehouse when one has been assigned. The same supervisor may not be assigned to more than one warehouse, per company policy XYZ. |
|
| warehouse_description | text |
| Name | Constraint |
|---|---|
| warehouse_check | CHECK ((upper(warehouse_manager) <> upper(warehouse_supervisor))) |
| warehouse_warehouse_code_check | CHECK ((warehouse_code = upper(warehouse_code))) |
Tables referencing this one via Foreign Key Constraints:
Worker function appropriate for warehouses.
SELECT $1 * $1;
Generated by PostgreSQL Autodoc