Oracle OCP SQL Introduction
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Communicating with a RDBMS Using SQL
SQL statement is entered.
SELECT department_name FROM departments;
Statement is sent to Oracle Server.
Oracle server
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
number
*
name
o
location
Unique Identifier (UID) Primary marked with “#” Secondary marked with “(#)”
I-16
Copyright © Oracle Corporation, 2001. All rights reserved.
Database
Relational Database Concept
• Dr. E.F. Codd proposed the relational model for
database systems in 1970.
• It is the basis for the relational database
SQL Statements
SELECT
INSERT UPDATE DELETE MERGE CREATE ALTER DROP RENAME TRUNCATE
COMMIT ROLLBACK SAVEPOINT
GRANT REVOKE
Data retrieval Data manipulation language (DML)
structured query language (SQL) statements
• Contains a collection of tables with no physical
pointers
• Uses a set of operators
I-20
Copyright © Oracle Corporation, 2001. All rights reserved.
Documents
XML
Multimedia
Messages
I-6
Copyright © Oracle Corporation, 2001. All rights reserved.
Relational and Object Relational Database Management System
I-15
Copyright © Oracle Corporation, 2001. All rights reserved.
Entity Relationship Modeling Conventions
Entity Soft box Singular, unique name Uppercase Synonym in parentheses
I-3
Copyright © Oracle Corporation, 2001. All rights reserved.
Oracle9i
I-4
Copyright © Oracle Corporation, 2001. All rights reserved.
Oracle9i Application Server
Relating Multiple Tables
• Each row of data in a table is uniquely
identified by a primary key (PK).
• You can logically relate data from multiple
tables using foreign keys (FK).
• List the features of Oracle9i • Discuss the theoretical and physical aspects of
a relational database
• Describe the Oracle implementation of the
RDBMS and ORDBMS
Table Name: EMPLOYEES
Table Name: DEPARTMENTS
…
Primary key
I-18
Foreign key Primary key
Copyright © Oracle Corporation, 2001. All rights reserved.
Relational Database Terminology
I-2
Copyright © Oracle Corporation, 2001. All rights reserved.
Oracle9i
Scalability
One vendor
Reliability
Single development
model
One management
interface
Common skill sets
Oracle server
Table Name: EMPLOYEES Table Name: DEPARTMENTS
…
I-13
…
Copyright © Oracle Corporation, 2001. All rights reserved.
Data Models
Model of system in client’s
Copyright © Oracle Corporation, 2001. All rights reserved.
System Development Life Cycle
Strategy and
analysis
Design
Build and document
Transition
Production
Portals
A
Transactional Apps
P
A
C
Business Iintelligence
H
E
Integration
I-5
Copyright © Oracle Corporation, 2001. All rights reserved.
Oracle9i Database
Object Relational Data
Data definition language (DDL)
Transaction control Data control language (DCL)
I-23
Copyright © Oracle Corporation, 2001. All rights reserved.
Tables Used in the Course
I-7
Copyright © Oracle Corporation, 2001. All rights reserved.
Oracle Internet Platform
Clients Any browser
Any mail client
Any FTP client
System management
Development tools
Internet applications
Business logic Presentation and
and data
business logic
Databases
Application servers
Network services
SQL PL/SQLJa来自aI-8Attribute Singular name Lowercase Mandatory marked with “*” Optional marked with “o”
EMPLOYEE
#*
number
*
name
o
job title
assigned to composed of
DEPARTMENT
#*
I-12
Copyright © Oracle Corporation, 2001. All rights reserved.
Definition of a Relational Database
A relational database is a collection of relations or two-dimensional tables.
Introduction
Copyright © Oracle Corporation, 2001. All rights reserved.
Objectives
After completing this lesson, you should be able to do the following:
I-9
Copyright © Oracle Corporation, 2001. All rights reserved.
Data Storage on Different Media
Electronic spreadsheet
Filing cabinet
I-11
Copyright © Oracle Corporation, 2001. All rights reserved.
DEPARTMENT
#*
number
*
name
o
location
• Scenario
– “. . . Assign one or more employees to a department . . .”
– “. . . Some departments do not yet have assigned employees . . .”
mind
Entity model of client’s model
Table model of entity model
Oracle server
Tables on disk
I-14
Copyright © Oracle Corporation, 2001. All rights reserved.
I-21
Copyright © Oracle Corporation, 2001. All rights reserved.
Relational Database Management System
Oracle server
User tables
Data dictionary
I-22
Copyright © Oracle Corporation, 2001. All rights reserved.
computing.
• Oracle9i is based on the object relational database
Entity Relationship Model
• Create an entity relationship diagram from business specifications or narratives
EMPLOYEE
#*
number
*
name
o
job title
assigned to composed of
EMPLOYEES
DEPARTMENTS
JOB_GRADES
I-24
Copyright © Oracle Corporation, 2001. All rights reserved.
Summary
• The Oracle9i Server is the database for Internet
• Relational model and object relational model • User-defined data types and objects • Fully compatible with relational database • Support of multimedia and large objects • High-quality database server features
2
3
4
6 5
1
I-19
Copyright © Oracle Corporation, 2001. All rights reserved.
Relational Database Properties
A relational database:
• Can be accessed and modified by executing