Anda di halaman 1dari 23

Introduction

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Lesson Objectives

After completing this lesson, you should be able to do the


following:
• Discuss the theoretical and physical aspects of a relational
database
• Describe Oracle server’s implementation of RDBMS and
object relational database management system
(ORDBMS)
• Identify the development environments that can be used
for this course
• Describe the database and schema used in this course

1-2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Lesson Agenda

• Overview of relational database management concepts


and terminologies
• Introduction to SQL and its development environments
• The HR schema and the tables used in this course
• Oracle Database 11g documentation and additional
resources

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

• Dr. E. F. Codd proposed the relational model for database


systems in 1970.
• It is the basis for the relational database management
system (RDBMS).
• The relational model consists of the following:
– Collection of objects or relations
– Set of operators to act on the relations
– Data integrity for accuracy and consistency

1-6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Definition of a Relational Database

A relational database is a collection of relations or


two-dimensional tables controlled by the Oracle server.

Oracle
server

Table name: EMPLOYEES Table name: DEPARTMENTS

… …

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

• Create an entity relationship diagram from business


specifications or narratives:

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

Unique Identifier (UID)


Primary marked with “#”
Secondary marked with “(#)”

1 - 11 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Relating Multiple Tables

• Each row of data in a table can be uniquely identified by a


primary key.
• You can logically relate data from multiple tables using
foreign keys.
Table name: DEPARTMENTS

Table name: EMPLOYEES


Primary key
Primary key Foreign key

1 - 13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Relational Database Terminology
COLUMN
(NON-KEY) 3 COLUMN
4 (FOREIGN
COLUMN 2 KEY)
(PRIMARY
KEY)
5 FIELD
6
FIELD (WITH
NULL VALUE)

ROW 1

1 - 15 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Lesson Agenda

• Overview of relational database management concepts


and terminologies
• Introduction to SQL and its development environments
• The HR schema and the tables used in this course
• Oracle Database 11g documentation and additional
resources

1 - 17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Using SQL to Query Your Database

Structured query language (SQL) is:


• The ANSI standard language for operating relational
databases
• Efficient, easy to learn, and use
• Functionally complete (With SQL, you can define, retrieve,
and manipulate data in the tables.)
SELECT department_name
FROM departments;
Oracle
server

1 - 18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


SQL Statements Used in the Course

SELECT
INSERT
UPDATE Data manipulation language (DML)
DELETE
MERGE

CREATE
ALTER
DROP Data definition language (DDL)
RENAME
TRUNCATE
COMMENT

GRANT Data control language (DCL)


REVOKE

COMMIT
ROLLBACK Transaction control
SAVEPOINT

1 - 19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Development Environments for SQL

There are two development environments for this course:


• The primary tool is Oracle SQL Developer.
• SQL*Plus command-line interface can also be used.

SQL*Plus
SQL Developer

1 - 20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Lesson Agenda

• Overview of relational database management concepts


and terminologies
• Introduction to SQL and its development environments
• The HR schema and the tables used in this course
• Oracle Database 11g documentation and additional
resources

1 - 21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Human Resources (HR) Schema

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

1 - 22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Tables Used in the Course
EMPLOYEES

JOB_GRADES DEPARTMENTS

1 - 23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Lesson Agenda

• Course objectives, course agenda, and appendixes used


in this course
• Overview of Oracle Database 11g and related products
• Overview of relational database management concepts
and terminologies
• Introduction to SQL and its development environments
• The HR schema and the tables used in this course
• Oracle Database 11g documentation and additional
resources

1 - 24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Oracle Database Documentation

• Oracle Database New Features Guide


• Oracle Database Reference
• Oracle Database SQL Language Reference
• Oracle Database Concepts
• Oracle Database SQL Developer User's Guide

1 - 25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Additional Resources

For additional information about Oracle Database 11g, refer to


the following:
• Oracle Database 11g: New Features eStudies
• Oracle Learning Library:
– http://www.oracle.com/goto/oll

1 - 26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.


Summary

In this lesson, you should have learned that:


• The database is based on ORDBMS
• Relational databases are composed of relations, managed
by relational operations, and governed by data integrity
constraints
• With the Oracle server, you can store and manage
information by using SQL

1 - 27 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Anda mungkin juga menyukai