この図は、HRスキーマの表と各表の列、および表の間の依存性を示しています。
employees
表の属性は、次のとおりです。
列: employee_id
(主キー)、first_name
、last_name
、email
、phone_number
、hire_date
、job_id
、salary
、commission_pct
、manager_id
、department_id
関係:
列department_id
は、employees
表の各行を、departments
表のdepartment_id
のうちの1つの値に関連付けます。
列job_id
は、employees
表の各行を、jobs
表のjob_id
のうちの1つの値に関連付けます。
列employee_id
は、employees
表の各行を、job_history
表のemployee_id
のうちの0行以上の行に関連付けます。
列manager_id
は、対応するemployee_id
を介して、employees
表の他の0行または1行を参照します。通常、会社の最高責任者にマネージャはいません。
その他の関係:
列employee_id
は、employees
表の行をoe.orders
表の列sales_rep_id
に関連付けます。
列employee_id
は、employees
表の行をoe.customers
表の列account_mgr_id
に関連付けます。
jobs
表の属性は、次のとおりです。
列: job_id
(主キー)、job_title
、min_salary
、max_salary
関係:
列job_id
は、jobs
表の各行を、employees
表の列jobs_id
のうちの対応する値に関連付けます。
列job_id
は、jobs
表の0行以上の行を、
job_history
表の列jobs_id
のうちの対応する値に関連付けます。
job_history
表の属性は、次のとおりです。
列: employee_id
およびstart_date
(複合主キー)、end_date
、job_id
、department_id
関係:
各job_history
レコードは、employee_id
を介して、employees
表のレコードに関連付けられます。
departments
表の属性は、次のとおりです。
列: department_id
(主キー)、department_name
、manager_id
、location_id
関係:
列department_id
は、departments
表の各行を、employees
表の行のうちのdepartment_id
に対応する値を持つ0行以上の行に関連付けます。
列manager_id
は、departments
表の各行を、employees
表の行のうちのemployee_id
に対応する値を持つ行に関連付けます。
列location_id
は、departments
表の各行を、locations
表の行のうちのlocation_id
に対応する値を持つ行に関連付けます。
locations
表の属性は、次のとおりです。
列: location_id
(主キー)、street_address
、postal_code
、city
、state_province
、country_id
関係:
列location_id
は、locations
表の各行を、departments
表の行のうちのlocation_id
に対応する値を持つ0行以上の行に関連付けます。
列country_id
は、locations
表の各行を、countries
表の行のうちのcountry_id
に対応する値を持つ行に関連付けます。
その他の関係:
列location_id
は、locations
表の行を、eo.warehouses
表の行のうちのlocation_id
に対応する値を持つ0行以上の行に関連付けます。
countries
表の属性は、次のとおりです。
列: country_id
(主キー)、country_name
、region_id
関係:
列region_id
は、countries
表の各行を、regions
表の行のうちのregion_id
に対応する値を持つ行に関連付けます。
列country_id
は、countries
表の各行を、locations
表の行のうちのcountry_id
に対応する値を持つ0行以上の行に関連付けます。
regions
表の属性は、次のとおりです。
列: region_id
(主キー)、region_name
関係:
列region_id
は、regions
表の各行を、countries
表の行のうちのregion_id
に対応する値を持つ0行以上の行に関連付けます。
また、この図は、OEスキーマについて説明し、2つのスキーマ間の依存性を表しています。
order_items
表の属性は、次のとおりです。
列: order_id
(主キー)、line_item_id
、product_id
、unit_price
、quantity
関係:
列order_id
は、order_items
表の1行以上の行を、orders
表の行のうちのorder_id
に対応する値を持つ1行に関連付けます。
列product_id
は、order_items
表の1行以上の行を、product_information
表の行のうちのproduct_id
に対応する値を持つ1行に関連付けます。
orders
表の属性は、次のとおりです。
列: order_id
(主キー)、order_date
、order_mode
、customer_id
、order_status
、order_total
、sales_rep_id
、promotion_id
関係:
列order_id
は、orders
表の1行を、order_items
表の行のうちのorder_id
に対応する値を持つ1行以上の行に関連付けます。
列customer_id
は、orders
表の1行以上の行を、customers
表のうちのcustomer_idに対応する値を持つ1行に関連付けます。
その他の関係:
列sales_rep_id
は、orders
表の1行以上の行を、hr.employees
表の行のうちのemployee_id
に対応する値を持つ1行に関連付けます。
product_information
表の属性は、次のとおりです。
列: product_id
(主キー)、product_name
、product_description
、category_id
、weight_class
、warranty_period
、supplier_id
、product_status
、list_price
、min_price
、catalog_url
関係:
列product_id
は、product_information
表の1行を、order_items
表の行のうちのproduct_id
に対応する値を持つ1行以上の行に関連付けます。
列product_id
は、product_information
表の1行を、product_descriptions
表の行のうちのproduct_id
に対応する値を持つ0行以上の行に関連付けます。
列product_id
は、product_information
表の1行を、inventories
表の行のうちのproduct_id
に対応する値を持つ0行以上の行に関連付けます。
product_descriptions
表の属性は、次のとおりです。
列: product_id
およびlanguage_id
(複合主キー)、translated_name
、translated_description
関係:
列product_id
は、product_descriptions
表の1行以上の行を、product_information
表の行のうちのproduct_id
に対応する値を持つ1行に関連付けます。
inventories
表の属性は、次のとおりです。
列: product_id
およびwarehouse_id
(複合主キー)、quantity_on_hand
関係:
列product_id
は、inventories
表の1行以上の行を、product_information
表の行のうちのproduct_id
に対応する値を持つ1行に関連付けます。
列warehouse_id
は、inventories
表の1行以上の行を、warehouses
表のうちのwarehouse_id
に対応する値を持つ1行に関連付けます。
customers
表の属性は、次のとおりです。
列: customer_id
(主キー)、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
、income_level
関係:
列customer_id
は、customers
表の行を、orders
表のうちのcustomer_id
に対応する値を持つ1行以上の行に関連付けます。
その他の関係:
列acct_mgr_id
は、customers
表の1行以上の行を、hr.employees
表の行のうちのemployee_id
に対応する値を持つ1行に関連付けます。
warehouses
表の属性は、次のとおりです。
列: warehouse_id
(主キー)、warehouse_spec
、warehouse_name
、location_id
、wh_geo_location
関係:
列warehouse_id
は、warehouses
表の行を、inventories
表のうちのwarehouse_id
に対応する値を持つ1行以上の行に関連付けます。
その他の関係:
列location_id
は、warehouses
表の1行以上の行を、hr.locations
表の行のうちのlocation_id
に対応する値を持つ1行に関連付けます。