+ All Categories
Home > Documents > 902410_chap01

902410_chap01

Date post: 10-Apr-2018
Category:
Upload: srav2010
View: 220 times
Download: 0 times
Share this document with a friend

of 32

Transcript
  • 8/8/2019 902410_chap01

    1/32

    A Guide to Oracle9i 1

    Client/Server Databases and

    the Oracle9iRelationalDatabase

    Chapter 1

  • 8/8/2019 902410_chap01

    2/32

    A Guide to Oracle9i 2

    Objectives Develop an understanding of the purpose of database systems

    Become familiar with the structure of a relational database and

    review relational database concepts and terms

    Explore the differences between personal databases andclient/server databases

    Learn about the Clearwater Traders sales order database, theNorthwoods University student registration database, and theSoftware Experts project management database

  • 8/8/2019 902410_chap01

    3/32

    A Guide to Oracle9i 3

    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

  • 8/8/2019 902410_chap01

    4/32

    A Guide to Oracle9i 4

    Problems with Files

    Proliferation of

    data management

    programs to dealwith different file

    formats

    Redundant data

    stored in files

    Data files may

    contain

    inconsistent data

  • 8/8/2019 902410_chap01

    5/32

    A Guide to Oracle9i 5

    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

  • 8/8/2019 902410_chap01

    6/32

    A Guide to Oracle9i 6

    Early Databases

    Hierarchical Structure

  • 8/8/2019 902410_chap01

    7/32

    A Guide to Oracle9i 7

    Relational Databases

  • 8/8/2019 902410_chap01

    8/32

    A Guide to Oracle9i

    8

    Relational Database Terms Entity: an object about which you want to store data

    Relationships: links that show how different recordsare related

    Key Fields: establish relationships among records indifferent tables

    Five main types of key fields: primary keys

    candidate keys surrogate keys

    foreign keys

    composite keys

  • 8/8/2019 902410_chap01

    9/32

    A Guide to Oracle9i

    9

    Primary Keys

    Primary key Value must be unique for each record

    Serves to identify the record

    Present in every record

    Cant be NULL

    Should be numeric

  • 8/8/2019 902410_chap01

    10/32

    A Guide to Oracle9i

    10

    Candidate Keys

    Candidate key Any field that could be used as the primary key

    Should be a unique, unchanging numeric field

  • 8/8/2019 902410_chap01

    11/32

    A Guide to Oracle9i

    11

    Surrogate Keys Surrogate key: created to be the records primary key identifier when

    no suitable primary key exists

    Surrogate key has no real relationship to the record to which it isassigned, other than to identify the record uniquely

    Developers configure the database to generate surrogate key valuesautomatically

    In an Oracle database, you can automatically generate surrogate keyvalues using a sequence

    Surrogate keys are always numerical fields, because the databasegenerates surrogate key values automatically by incrementing theprevious value by one

  • 8/8/2019 902410_chap01

    12/32

    A Guide to Oracle9i

    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

  • 8/8/2019 902410_chap01

    13/32

    A Guide to Oracle9i

    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

  • 8/8/2019 902410_chap01

    14/32

    A Guide to Oracle9i

    14

    Personal Database

    Management Systems DBMS and database applications run on the same workstation and

    appear to the user as a single integrated application

    Personal databases used primarily for creating single-user databaseapplications

    Support small multiuser database applications by storing the database

    application files on a file server instead of on a single users workstation

    and then transmitting the files or the parts of files containing the desired

    data to various users across a network

    Database developers should use a personal database only for non-

    mission-critical applications

  • 8/8/2019 902410_chap01

    15/32

    A Guide to Oracle9i

    15

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

  • 8/8/2019 902410_chap01

    16/32

    A Guide to Oracle9i

    16

    Client/Server Database Architecture

  • 8/8/2019 902410_chap01

    17/32

    A Guide to Oracle9i

    17

    The Oracle9iClient/Server Database

    Oracle9iis the latest release of Oracle Corporations relationaldatabase

    All Oracle server- and client-side programs use Oracle Net, a

    utility that enables the network communication between the

    client and the server

  • 8/8/2019 902410_chap01

    18/32

    A Guide to Oracle9i

    18

    Client-Side Utilities SQL*Plus

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

    Oracle9iDeveloper Suite

    for developing database applications including the followingDeveloper 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 newuser accounts and configuring how the DBMS stores and managesdata

  • 8/8/2019 902410_chap01

    19/32

    A Guide to Oracle9i

    19

    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

  • 8/8/2019 902410_chap01

    20/32

    A Guide to Oracle9i

    20

    The Clearwater Traders

    Sales Order Database

    Clearwater Traders

    Markets a line of clothing and sporting goods via mail-order

    catalogs

    Accepts customer orders via telephone, mail, and fax

    Wants to begin accepting orders using its Web site

    Has decided to offer 24-hour customer order service

    Existing microcomputer-based database system cannot handle

    current transaction volume Managers concerned that the current database does not have

    the failure-handling and recovery capabilities needed for an

    ordering system that cannot tolerate failures or downtime

  • 8/8/2019 902410_chap01

    21/32

    A Guide to Oracle9i

    21

    Clearwater Traders Data

    Requirements Customer name, address, daytime and evening telephone numbers,

    user names, and passwords

    Order date, payment method (check or credit card), order source(catalog description or Web site), and associated item numbers, sizes,colors, and quantities ordered

    Item descriptions and photo images, as well as item categories(womens clothing, outdoor gear, and so on), prices, and quantities onhand. Many clothing items are available in multiple sizes and colors.

    Sometimes the same item has different prices depending on the itemsize

    Information about incoming product shipments

  • 8/8/2019 902410_chap01

    22/32

    A Guide to Oracle9i

    22

    Clearwater Traders

    Table Relationships

  • 8/8/2019 902410_chap01

    23/32

    A Guide to Oracle9i

    23

    The Northwoods University

    Student Registration Database

    Northwoods University

    Decided to replace its aging mainframe-based

    student registration system with a more modernclient/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

  • 8/8/2019 902410_chap01

    24/32

    A Guide to Oracle9i

    24

    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

  • 8/8/2019 902410_chap01

    25/32

    A Guide to Oracle9i

    25

    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, andPIN

    Student enrollment and grade information

  • 8/8/2019 902410_chap01

    26/32

    A Guide to Oracle9i 26

    Northwoods University

    Table Relationships

  • 8/8/2019 902410_chap01

    27/32

    A Guide to Oracle9i 27

    The Software Experts Project

    Management DatabaseSoftware Experts Consulting firm that creates custom software applications

    Managers determine the number and the skill sets of the consultantsthat a given project requires

    Managers locate available consultants with the necessary skills

    One consultant is named project manager

    When completed, the project manager evaluates all the otherconsultants and all the consultants evaluate the project manager

    A project can be subdivided into multiple subprojects

  • 8/8/2019 902410_chap01

    28/32

    A Guide to Oracle9i 28

    Software Experts Requirements

    Consultant information, including name, address, city,

    state, ZIP code, phone number, and e-mail address

    Descriptions of consultant skills

    Client information, including the client name, client contact

    name, and contact phone number

  • 8/8/2019 902410_chap01

    29/32

    A Guide to Oracle9i 29

    Software Experts Requirements

    Project information, including the project name, the client

    associated with the project, associated subprojects, the

    project manager, and required skill sets

    Dates that a consultant started and finished working on a

    specific project and total days that the consultant spent

    working on the project

    Consultant evaluation information, including the date theevaluation was completed, who performed the evaluation,

    and the evaluation score and comments

  • 8/8/2019 902410_chap01

    30/32

    A Guide to Oracle9i 30

    Software Experts Table

    Relationships

  • 8/8/2019 902410_chap01

    31/32

    A Guide to Oracle9i 31

    Summary

    A database stores all organizational data in a central location

    Database management system (DBMS) provides a central set

    of common functions for managing a database, including

    Inserting

    Updating

    Retrieving

    Deleting data values

    Most modern databases are relational databases

    Store data in a tabular format

    Columns represent different data fields

    Rows contain individual data records

  • 8/8/2019 902410_chap01

    32/32

    A Guide to Oracle9i 32

    Summary

    In a relational database

    Data about different entities is stored in separate tables

    You create relationships that link related data using key

    fields

    A database system consists of

    DBMS: manages the physical data storage

    Database applications: provide the user interface to the

    database

    Many database systems use a client/server architecture

    DBMS runs as a server process

    Database applications run as client processes