You are on page 1of 20

Introduction

Agenda

• Classification of data
• Overview of relational database management concepts
• Introduction to SQL
• SQL development environments
• The HR schema and the tables used in this course

I-2
Classification of data

• Structured data
• Structured data concerns all data which can be stored in database
SQL in a table with rows and columns. Example: Relational data.
• Semi-Structured data
• Semi-structured data is information that does not reside in a
relational database but that has some organizational properties that
make it easier to analyze. Example: XML, JSON data.
• Unstructured data
• Unstructured data is a data which is not organized in a predefined
manner or does not have a predefined data model. Example: Word,
PDF, Text, videos.

I-3
Data Storage on Different Media

Electronic
Files Database
spreadsheet

I-4
Agenda

• Classification of data
• Overview of relational database management concepts
• Introduction to SQL
• SQL development environments
• The HR schema and the tables used in this course

I-5
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

I-6
Definition of a Relational Database

A relational database is a collection of relations or two-dimensional


tables.

Oracle server

Table name: EMPLOYEES Table name: DEPARTMENTS

… …

I-7
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

I-8
Entity Relationship Model

• Create an entity relationship diagram from business


specifications:

EMPLOYEE DEPARTMENT
assigned to
#* number #* number
* name * name
job title composed of location
o o
• Scenario:
– “. . . Assign one or more employees to a
department . . .”

I-9
Relating Multiple Tables

• Each row of data in a table is 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 Foreign key Primary key

I - 25
Agenda

• Classification of data
• Overview of relational database management concepts
• Introduction to SQL
• SQL development environments
• The HR schema and the tables used in this course

I - 11
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

I - 30
SQL Statements

SELECT

INSERT Data manipulation language (DML)

UPDATE

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

GRANT Data control language (DCL)


REVOKE

COMMIT
ROLLBACK Transaction control
SAVEPOINT

I - 31
Agenda

• Classification of data
• Overview of relational database management concepts
• Introduction to SQL
• SQL development environments
• The HR schema and the tables used in this course

I - 14
Development Environments for SQL

There are two development environments for this course:


• Primary tool is Oracle SQL Developer
• SQL*Plus command line interface may also be used

SQL Developer SQL *Plus

I - 32
Agenda

• Classification of data
• Overview of relational database management concepts
• Introduction to SQL
• SQL development environments
• The HR schema and the tables used in this course

I - 16
The 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
employee_id
end_date
first_name
job_id last_name
department_id COUNTRIES
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
region_id
max_salary
region_name

I - 34
Tables Used in the Course

EMPLOYEES

DEPARTMENTS JOB_GRADES

I - 35
Course Objectives

After completing this course, you should be able to:


• Retrieve row and column data from tables with the SELECT
statement
• Create reports of sorted and restricted data
• Employ SQL functions to generate and retrieve customized
data
• Run complex queries to retrieve data from multiple tables
• Run data manipulation language (DML) statements to
update data in Oracle Database 11g
• Run data definition language (DDL) statements to create
and manage schema objects

I - 19
Resources

Oracle Database Playlist:


• https://www.youtube.com/playlist?list=PLsfs9DojDVqOVtJiWhUZ2yK
WTbQqcbmEF

I - 40

You might also like