Beruflich Dokumente
Kultur Dokumente
1-2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Lesson Agenda
1-3 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Relational and Object Relational
Database Management Systems
• Relational model and object relational model
• User-defined data types and objects
• Fully compatible with relational database
• Supports multimedia and large objects
• High-quality database server features
1-4 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Data Storage on Different Media
Electronic
Filing cabinet Database
spreadsheet
1-5 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Relational Database Concept
1-6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Definition of a Relational Database
Oracle
server
… …
1-7 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Data Models
Model of
Entity model of
system
client’s model
in client’s
mind
Table model
of entity model Oracle
server
Tables on disk
1-8 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Entity Relationship Model
EMPLOYEE DEPARTMENT
assigned to
#* number #* number
* name * name
o job title composed of o location
• Scenario:
– “. . . Assign one or more employees to a
department . . .”
– “. . . Some departments do not yet have assigned employees
. . .”
1-9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Entity Relationship Modeling Conventions
Entity: Attribute:
• Singular, unique name • Singular name
• Uppercase • Lowercase
• Mandatory marked with “*”
• Soft box • Optional marked with “o”
• Synonym in parentheses
EMPLOYEE DEPARTMENT
#* number assigned to
#* number
* name * name
o job title composed of o location
…
Primary key
Primary key Foreign key
ROW 1
SELECT
INSERT
UPDATE Data manipulation language (DML)
DELETE
MERGE
CREATE
ALTER
DROP Data definition language (DDL)
RENAME
TRUNCATE
COMMENT
COMMIT
ROLLBACK Transaction control
SAVEPOINT
SQL*Plus
SQL Developer
DEPARTMENTS LOCATIONS
department_id location_id
department name street address
manager_id postal code
location_id city
state province
Country id
JOB_HISTORY
employee_id
start_date
EMPLOYEES
end_date employee_id
first_name
job_id
last_name COUNTRIES
department_id
email country_id
phone_number country_name
hire_date region_id
job_id
salary
commission_pct
JOBS manager_id
job_id department_id
job_title
min_salary
REGIONS
max_salary region_id
region_name
JOB_GRADES DEPARTMENTS