Download Oracle Server - CIT

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

DBase wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Relational algebra wikipedia , lookup

Microsoft Access wikipedia , lookup

Concurrency control wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Functional Database Model wikipedia , lookup

Ingres (database) wikipedia , lookup

Navitaire Inc v Easyjet Airline Co. and BulletProof Technologies, Inc. wikipedia , lookup

Database wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Clusterpoint wikipedia , lookup

Oracle Database wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Database model wikipedia , lookup

SQL wikipedia , lookup

Relational model wikipedia , lookup

PL/SQL wikipedia , lookup

Transcript
Database Foundations
6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Roadmap
Introduction to
Oracle
Application
Express
Retrieving
Data Using
SELECT
You are here
Structured
Query
Language
(SQL)
Data Definition
Language
(DDL)
Restricting
Data Using
WHERE
DFo 6-2
Structured Query Language (SQL)
Data
Manipulation
Language
(DML)
Sorting Data
Using ORDER
BY
Transaction
Control
Language (TCL)
Joining Tables
Using JOIN
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
3
Objectives
This lesson covers the following objectives:
• Describe how data is organized in a relational database
• Explain the various relational database terminologies
• Define the structured query language and its functions
• Describe how SQL processing takes place
• Identify the tools used to access the relational database
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
4
How Is Data Organized in Relational
Databases?
– Data is stored in a two-dimensional matrix known as a table.
– RDBMS software is used to manage reading and manipulating
data.
Oracle
Server
Table name: EMPLOYEES
Table name: DEPARTMENTS
…
…
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
5
Relational Database Terminology
3
4
2
6
5
1
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
6
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
Foreign key
Primary key
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
7
What Is SQL?
• Structured query language (SQL) is the set-based,
declarative language used to access data in an Oracle
database.
• SQL provides an interface to a relational database and
provides statements that help work with the database.
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
8
Functions of SQL
• Creating, replacing, altering, and dropping database
objects
• Inserting, updating, and deleting rows in a table
• Querying data stored in the database
• Controlling access to the database and database
objects
• Guaranteeing database consistency and integrity
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
9
SQL Processing
Stages of SQL processing
Parsing
Optimization
DFo 6-2
Structured Query Language (SQL)
Row Source
Generation
Execution
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
10
Accessing Data in the Oracle Database
Server
SQL*Plus
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
11
Case Scenario: Need to Extract Data
Faculty
Sean, by now you should understand the need to
use SQL to access data in a relational database. Can
you think of scenarios where retrieving data from a
database table would be necessary?
Sure. Let me think of some use cases.
Student
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
12
Use Cases
Hospitals
Retail
Airports
Schools
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
13
Connecting to an Oracle Database
• You can connect to an Oracle database through a client
program such as:
– SQL*Plus
– Oracle SQL Developer
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
14
Connecting to an Oracle Database Using
SQL*Plus
a
b
c
d
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
15
Connecting to an Oracle Database Using
Oracle SQL Developer
a
b
c
d
DFo 6-2
Structured Query Language (SQL)
e
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
16
Summary
In this lesson, you should have learned how to:
• Describe how data is organized in a relational database
• Explain the various relational database terminologies
• Define the structured query language and its functions
• Describe how SQL processing takes place
• Identify the tools used to access the relational database
DFo 6-2
Structured Query Language (SQL)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
17