1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field...

22
1 Introduction to Oracle Chapter 1

Transcript of 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field...

Page 1: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

1

Introduction to Oracle

Chapter 1

Page 2: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

2

Before Databases

Information was kept in files: Each field describes one piece of information about student Fields are separated by commas A record is a collection of related fields Each record is a separate line

Page 3: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

3

Problems with Files

Proliferation of data management programs to deal with different file formats

Redundant data stored in files

Data files may contain inconsistent data

Page 4: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

4

Database Approach

Database stores all organizational data in a central location

Good database design eliminates redundant data to reduce the possibility of inconsistent data

Single application called the database management system (DBMS) performs all routine data handling operations

Database administrator (DBA): person responsible for installing, administering, and maintaining the database

Page 5: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

5

Types of database models

hierarchical model network model relational model object oriented model.

Page 6: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

6

Early Databases – Hierarchical Structure

Page 7: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

7

Relational Databases

Page 8: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

8

Object-oriented Example

StudentsCourses

Page 9: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

9

Relational Database Terms

Entity: an object about which you want to store data Relationships: links that show how different records

are related Key Fields: establish relationships among records in

different tables Five main types of key fields:

primary keyscandidate keys foreign keyscomposite keys

Page 10: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

10

Primary Keys

Primary keyValue must be unique for each recordServes to identify the recordPresent in every recordCan’t be NULLShould be numeric

Page 11: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

11

Candidate Keys

Candidate key Any field that could be used as the

primary keyShould be a unique, unchanging

numeric field

Page 12: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

12

Foreign Keys

Foreign key: a field in a table that is a primary key in another table Foreign key creates a relationship between the two tables Foreign key value must exist in the table where it is a primary key

Page 13: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

13

Composite Keys

Composite key: a unique key that you create by combining two or more fields

Usually comprised of fields that are primary keys in other tables

Page 14: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

14

Client/Server Database Management Systems

Client/server database Takes advantage of distributed processing and networked

computers by distributing processing across multiple computers DBMS server process runs on one workstation, and the

database applications run on separate client workstations across the network

Preferred for database applications that retrieve and manipulate small amounts of data from databases containing large numbers of records because they minimize network traffic and improve response times

Organizations generally use a client/server database if the database will have more than 10 simultaneous users and if the database is mission critical

Page 15: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

15

Client/Server Database Architecture

Page 16: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

16

The Oracle Client/Server Database Oracle11i is the latest release of Oracle Corporation’s

relational database All Oracle server- and client-side programs use Oracle Net,

a utility that enables the network communication between the client and the server

Page 17: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

17

Client-Side Utilities SQL*Plus

for creating and testing command-line SQL queries and executing PL/SQL procedural programs

Oracle10i Developer Suite for developing database applications including the following

Developer tools: Forms Builder

for creating custom user applications Reports Builder

for creating reports for displaying, printing, and distributing summary data

Enterprise Manager for performing database administration tasks such as creating new

user accounts and configuring how the DBMS stores and manages data

Page 18: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

18

Design Principles

To avoid creating tables that contain redundant data, group related items that describe a single entity together in a common table

Do not create tables that duplicate values many times in different rows

When creating a database and inserting data values, you must specify the data type for each column

Recall that primary key fields should use a number data type to avoid typographical, punctuation, and case variation errors

Page 19: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

19

The Northwoods University Student Registration Database

Northwoods University Decided to replace its aging mainframe-based

student registration system with a more modern client/server database system

School officials want students to be able to retrieve course availability information, register for courses, and print transcripts using personal computers located in the student computer labs

Page 20: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

20

The Northwoods University Student Registration Database (cont)

Faculty members must be able to retrieve student course lists, drop and add students, and record course grades

Faculty members must also be able to view records for the students they advise

Security is a prime concern, so student and course records must be protected by password access

Page 21: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

21

Northwoods University Data Requirements

Student name, address, telephone number, class (freshman, sophomore, junior, or senior), date of birth, PIN (personal identification number), and advisor ID

Course call number (such as MIS 101), course name, credits, location, duration, maximum enrollment, instructor, and term offered

Instructor name, office location, telephone number, rank, and PIN

Student enrollment and grade information

Page 22: 1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.

22

Northwoods University Table Relationships