Description of the illustration comsc008.eps
This figure shows the relational tables in schema HR and the columns in each table, as well as dependencies between the tables.
The employees table has the following attributes:
-
Columns:
employee_id(primary key),first_name,last_name,email,phone_number,hire_date,job_id,salary,commission_pct,manager_id,department_id. -
Relationships:
-
Column
department_idrelates each row of the tableemployeesto exactly one value ofdepartment_idin the tabledepartments -
Column
job_idrelates each row of the tableemployeesto exactly one value ofjob_idin the tablejobs -
Column
employee_idrelates each row of the tableemployeesto none or more rows ofemployee_idin thejob_historytable -
Column
manager_idreferences none or one other row of theemployeestable through a matchingemployee_id; note that a head of the company would typically not have a manager
-
-
Other relationships:
-
Column
employee_idrelates rows of the tableemployeestosales_rep_idcolumns in the tableoe.orders -
Column
employee_idrelates rows of the tableemployeestoaccount_mgr_idcolumns in the tableoe.customers
-
The jobs table has the following attributes:
-
Columns:
job_id(primary key),job_title,min_salary, andmax_salary -
Relationships:
-
Column
job_idrelates each row of the tablejobsto the corresponding values in thejobs_idcolumn of the tableemployees -
Column
job_idrelates none or more rows of the tablejobsto the corresponding values in thejobs_idcolumn of the tablejob_history
-
The job_history table has the following attributes:
-
Columns:
employee_idandstart_date(a composite primary key),end_date,job_id, anddepartment_id. -
Relationships:
-
Each
job_historyrecord is associated with a record in the tableemployeesthrough theemployee_id.
-
The departments table has the following attributes:
-
Columns:
department_id(primary key),department_name,manager_id, andlocation_id. -
Relationships:
-
Column
department_idrelates each row of the tabledepartmentsto none or more rows of the tableemployeesthat have corresponding values fordepartment_id. -
Column
manager_idrelates each row of the tabledepartmentsto a row of the tableemployeesthat has the corresponding value foremployee_id. -
Column
location_idrelates each row of the tabledepartmentsto a row of the tablelocationsthat has the corresponding value forlocation_id.
-
The locations table has the following attributes:
-
Columns:
location_id(primary key),street_address,postal_code,city,state_province, andcountry_id. -
Relationships:
-
Column
location_idrelates each row of the tablelocationsto none or more rows of the tabledepartmentsthat have the corresponding values forlocation_id. -
Column
country_idrelates each row of the tablelocationsto a row in the tablecountriesthat has the corresponding value forcountry_id.
-
-
Other relationships:
-
Column
location_idrelates rows of the tablelocationsto none or more rows of the tableeo.warehousesthat have the corresponding values forloacation_id.
-
The countries table has the following attributes:
-
Columns:
country_id(primary key),country_name, andregion_id. -
Relationships:
-
Column
region_idrelates each row of the tablecountriesto a row in the tableregionsthat has the corresponding value forregion_id. -
Column
country_idrelates each row of the tablecountriesto none or more rows in the tablelocationsthat have the corresponding values forcountry_id.
-
The regions table has the following attributes:
-
Columns:
region_id(primary key), andregion_name. -
Relationships:
-
Column
region_idrelates rows of the tableregionsto none or more rows of the tablecountriesthat have the corresponding values forregion_id.
-
This graphic also describes schema OE and shows the dependencies between the two schemas.
The order_items table has the following attributes:
-
Columns:
order_id(primary key),line_item_id,product_id,unit_price, andquantity. -
Relationships:
-
Column
order_idrelates one or more rows of the tableorder_itemsto one row of the tableorderswith the corresponding value oforder_id. -
Column
product_idrelates one or more rows of the tableorder_itemsto one row of the tableproduct_informationwith the corresponding value ofproduct_id.
-
The orders table has the following attributes:
-
Columns:
order_id(primary key),order_date,order_mode,customer_id,order_status,order_total,sales_rep_id,promotion_id -
Relationships:
-
Column
order_idrelates one row of the tableordersto one or more rows of the tableorder_itemswith the corresponding values of theorder_id. -
Column
customer_idrelates one or more rows of the tableordersto one row of the tablecustomerswith the corresponding value of customer_id.
-
-
Other Relationships:
-
Column
sales_rep_idrelates one or more rows of the tableordersto one row of the tablehr.employeeswith the corresponding value ofemployee_id.
-
The product_information table has the following attributes:
-
Columns:
product_id(primary key),product_name,product_description,category_id,weight_class,warranty_period,supplier_id,product_status,list_price,product_id,min_price, andcatalog_url -
Relationships:
-
Column
product_idrelates one row of the tableproduct_informationto one or more rows of the tableorder_itemswith the corresponding value ofproduct_id. -
Column
product_idrelates one row of the tableproduct_informationto zero or more rows of the tableproduct_descriptionswith the corresponding value ofproduct_id. -
Column
product_idrelates one row of the tableproduct_informationto zero or more rows of the tableinventorieswith the corresponding value ofproduct_id.
-
The product_descriptions table has the following attributes:
-
Columns:
product_idandlanguage_id(composite primary key),translated_name, andtranslated_description -
Relationships:
-
Column
product_idrelates one or more rows of the tableproduct_descriptionsto a row of the tableproduct_informationwith the corresponding value ofproduct_id.
-
The inventories table has the following attributes:
-
Columns:
product_idandwarehouse_id(composite primary key), andquantity_on_hand. -
Relationships:
-
Column
product_idrelates one or more rows of the tableinventoriesto one row of the tableproduct_informationwith the corresponding value ofproduct_id. -
Column
warehouse_idrelates one or more rows of the tableinventoriesto one rows of the tablewarehouseswith the corresponding value ofwarehouse_id.
-
The customers table has the following attributes:
-
Columns:
customer_id(primary key),cust_first_name,cust_last_name,cust_address,phone_numbers,nls_language,nls_territory,credit_limit,cust_email,account_mgr_id,cust_geo_location,date_of_birth,marital_status,gender, andincome_level -
Relationships:
-
Column
customer_idrelates rows of the tablecustomersto one or more rows of the tableorderswith the corresponding value ofcustomer_id.
-
-
Other Relationships:
-
Column
acct_mgr_idrelates one or more rows of the tablecustomersto one row of the tablehr.employeeswith the corresponding value ofemployee_id.
-
The warehouses table has the following attributes:
-
Columns:
warehouse_id(primary key),warehouse_spec,warehouse_name,location_id, andwh_geo_location -
Relationships:
-
Column
warehouse_idrelates rows of the tablewarehousesto one or more rows of the tableinventorieswith the corresponding value ofwarehouse_id.
-
-
Other Relationships:
-
Column
location_idrelates one or more rows of the tablewarehousesto one row of the tablehr.locationswith the corresponding value oflocation_id.
-