DeZign for Databases - HTML Report
Author: Datanamic - DeZign for Databases - www.datanamic.com
Keywords: DEZIGNFORDBREPORT

Project Name | Crosstab sample db
Project Description | Sample database to use with DBIx::SQLCrosstab
Author | Giuseppe Maxia
Copyright | Giuseppe Maxia 2003
Target DBMS | MySQL 4
Generated On | 10/9/2003 1:26:35 PM

Entities with attributes

categories

Description

Personnel categories

Attributes

PK | Attribute Name | Data Type | Not Null | Unique | Description
Yes | cat_id | INTEGER | Yes | No |
No | category | CHAR(30) | Yes | No |

Relationships

Relationship Name | Type | Parent | Child | Description
categories_person | Non Identifying | categories | person |

class

Description

Sales categories

Attributes

PK | Attribute Name | Data Type | Not Null | Unique | Description
Yes | class_id | INTEGER | Yes | No |
No | class | CHAR(20) | Yes | No |

Relationships

Relationship Name | Type | Parent | Child | Description
class_sales | Identifying | class | sales |

countries

Description

Countries where locations belong

Attributes

PK | Attribute Name | Data Type | Not Null | Unique | Description
Yes | country_id | INTEGER | Yes | No |
No | country | CHAR(30) | Yes | No |

Relationships

Relationship Name | Type | Parent | Child | Description
countries_locations | Non Identifying | countries | locations |

customers

Description

Customers who are buying company products

Attributes

PK | Attribute Name | Data Type | Not Null | Unique | Description
Yes | customer_id | INTEGER | Yes | No |
No | customer | CHAR(40) | Yes | No |

Relationships

Relationship Name | Type | Parent | Child | Description
customers_sales | Identifying | customers | sales |

departments

Description

Company departments

Attributes

PK | Attribute Name | Data Type | Not Null | Unique | Description
Yes | dept_id | INTEGER | Yes | No |
No | dept | CHAR(30) | Yes | No |

Relationships

Relationship Name | Type | Parent | Child | Description
departments_person | Non Identifying | departments | person |

locations

Description

Locations where the employees work

Attributes

PK | Attribute Name | Data Type | Not Null | Unique | Description
Yes | loc_id | INTEGER | Yes | No |
No | loc | CHAR(30) | Yes | No |
No | country_id | INTEGER | Yes | No |

Relationships

Relationship Name | Type | Parent | Child | Description
locations_person | Non Identifying | locations | person |
countries_locations | Non Identifying | countries | locations |

person

Description

Table containing company employees

Attributes

PK | Attribute Name | Data Type | Not Null | Unique | Description
Yes | person_id | INTEGER | Yes | No |
No | name | CHAR(20) | Yes | No |
No | salary | INTEGER | No | No |
No | gender | CHAR(1) | No | No |
No | dept_id | INTEGER | Yes | No |
No | cat_id | INTEGER | Yes | No |
No | loc_id | INTEGER | Yes | No |

Relationships

Relationship Name | Type | Parent | Child | Description
person_sales | Identifying | person | sales |
departments_person | Non Identifying | departments | person |
locations_person | Non Identifying | locations | person |
categories_person | Non Identifying | categories | person |

sales

Description

Sales logs

Attributes

PK | Attribute Name | Data Type | Not Null | Unique | Description
Yes | person_id | INTEGER | Yes | No |
Yes | class_id | INTEGER | Yes | No |
Yes | sale_date | DATE | Yes | No |
Yes | customer_id | INTEGER | Yes | No |
No | sale_amount | INTEGER | Yes | No |

Relationships

Relationship Name | Type | Parent | Child | Description
person_sales | Identifying | person | sales |
customers_sales | Identifying | customers | sales |
class_sales | Identifying | class | sales |