Relational
Database
Design,
Usage,
and
Implementation
using Oracle
Compiled and Presented
by
Thomas P. Sturm, Ph.D.
Quantitative Methods and Computer Science
QMCS 450 - Database Design
The University of St. Thomas
St. Paul, Minnesota
© Copyright 1971 to 2002 Thomas P. Sturm
All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system,
or transmitted in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise, or translated into any language,
without prior written permission of the author.
Microsoft, Microsoft File, MS-DOS, MS-Windows, Windows, Windows
NT are registered trademarks of Microsoft Corporation
IBM, IBM-DOS, AS/400, AIX, OS/2, System R, SQL/DS, VM/CMS,
DOS/VSE, DB2, MVS, MVS/370, MVS/XA, and QMF are registered
trademarks of International Business Machines Corporation
pfs, pfs:File, and pfs:First Choice are registered trademarks of Software
Publishing Corporation
IDMS is a registered trademark of Cullinet Corporation
Ingres, Vifred, Vigraph, OSL, and ABF are registered trademarks of
Computer Associates
LISA is a registered trademark of Control Data Corporation
Oracle, SQL+, Designer 2000, Developer 2000, and PL/SQL are registered
trademarks of Oracle Corporation
MIDAS is a registered trademark of Pr1me Computer Corporation
Turbo C, Turbo C++, Borland C++, and Sidekick are registered trademarks
of Borland International, Inc.
UNIX is a registered trademark of UNIX System Laboratories, Inc.
VAX, Alpha, Alpha AXP, ACMS, ALL-IN-1, DEC, DECmessageQ,
DECnet, DECserver, Digital, OpenVMS, RMS, Ultrix, RdB, DBMS,
VMS, and VAX C are registered trademarks of Digital Equipment
Corporation
WordStar is a registered trademark of WordStar Corporation
DB Master, PC-File, System 2000, Focus, IMS, MDBS III, dbVista III are
registered trademarks of their respective owners.
Copyright © 1971-2002 Thomas P. Sturm
Relational Database Design, Usage, and Implementation
2
Relational Database Design, Usage,
and Implementation using Oracle
The goal of this course is to develop sound principles for determining the
value of information, what data should he stored, how it should he
organized, retrieved and managed to provide a manageably sized,
responsive, user-friendly, accurate, information-producing relational
database.
Objectives: By the end of the course, qualified and diligent student should
know:
The concepts of data and information and how data produces information
The identification procedure for entities and the procedure for determining
their interrelationships
The relational database model and how it differs from other database models
How to construct logical data structures for modeling data
How to construct a relational database starting from a logical data structure
How to construct a relational database starting from an existing collection of
data or existing “tables.”
The advantages and proper use of relational models
How to write simple queries in SQL that create, update, and retrieve data in a
relational database
How to present users with an appropriate “view” of the data
The criteria for determining to what extent commercial database management
systems are truly “relational.”
How to tune a relational system for efficiency
During the course, students will be given opportunity to:
Identify attributes, entities, values, and relationships
Use relational operators on a set of tables to produce information
Normalize an existing set of data into a set of well-formed relations
Construct a logical data structure
Map a logical data structure into a set of well-formed relations
Write SQL statements to query and update a database
Build an application using a fourth-generation development tool
Copyright © 1971-2002 Thomas P. Sturm
Relational Database Design, Usage, and Implementation
3
Relational Database Design, Usage,
and Implementation using Oracle
Course Schedule
ANALYSIS
Data Concepts
Introduction and justification
Concepts of data, information and database
The need for information-producing systems
Data base design goals
Definition of entity, attribute, value, and relationship
Database Concepts
Case Study 1
Database advantages and need for a database approach
Data independence
Data Models
Major non-relational database models
(flat file, indexed sequential, hierarchical, network)
Relational Database Model:
Conceptual structure
Definition of a relation
Relational operators
Understanding relational terminology
Elimination of redundancy.
Copyright © 1971-2002 Thomas P. Sturm
Relational Database Design, Usage, and Implementation
4
DESIGN
Modeling using Normalization:
Principles of logical database design
Various normal forms
(zeroth, first through fifth, projection-join)
Identification of keys and relationships
Normalizing existing forms and databases
Case study 2
Modeling using Logical Data Structures
LDS components
Relating entities, attributes, and relationships
Handling 1-1, 1-many, and many-many relationships
Modeling choices
Constraint modeling and enforcement
Mapping an LDS to well-formed relations
Modeling using Entity-Relationship Diagrams
E-R components
Relating entities, attributes, and relationships
Handling 1-1, 1-many, and many-many relationships
Modeling choices
Constraint modeling and enforcement
Mapping E-R diagrams to well-formed relations
Copyright © 1971-2002 Thomas P. Sturm
Relational Database Design, Usage, and Implementation
5
CONSTRUCTION
SQL:
ANSI standard query language
Table creation, update, and query operations
Table query for listing and summaries
Performing table joins
Creating end-user views.
Oracle:
Data definition
Back-end
Communications
SQL*Plus
Form system
PL/SQL and Embedded queries
Advanced SQL:
Field-level integrity
Table constraints and referential integrity
SQL for Oracle System Tables:
Listing of all tables, views, and fields
Access to all database attributes
Oracle SQL Plus:
Screen report formatting
SQL buffer/editor
Copyright © 1971-2002 Thomas P. Sturm
Relational Database Design, Usage, and Implementation
6
IMPLEMENTATION
Oracle PL/SQL:
Programming with SQL
Variables, blocks, loops
Fourth Generation Languages:
Application generation
Report generation
Data entry and screen painting
Oracle Developer 2000
Implementation:
Query optimization
Creating effective user views
Index creation
Designing read-only databases
Case study 3
Relational Database Criteria:
Measuring the ability to perform relational operations
Conformance to established relational database criteria
Levels of relational conformance
Codd's 12 rules
Advanced Topics:
Data warehousing
Data mining
Object-oriented databases
SQL 3 and object-relational databases
Distributed databases and client-server
Replication
Copyright © 1971-2002 Thomas P. Sturm
Relational Database Design, Usage, and Implementation
7
Outline
1. Data Concepts
2. Database Concepts
3. Data Models
4. Relational Model
5. Relational Design Concepts
6. Normalization
7. Logical Data Structures
8. Entity-Relationship Modeling
9. SQL
10. Oracle
11. Advanced SQL
12. SQL for Oracle System Tables
13. Oracle SQL*Plus
14. Oracle PL/SQL
15. Fourth Generation Languages
16. Oracle Forms
17. Oracle Reports
18. Developer 2000
19. Implementation
20. Read-Only Databases
21. Criteria for Relational Databases
22. Data Warehousing
23. Data Mining
24. Object-Oriented Databases
25. SQL 3 and Object-Relational
26. Distributed Databases & Client-Server
27. Replication
28. Exercises
29. References
Copyright © 1971-2002 Thomas P. Sturm
Relational Database Design, Usage, and Implementation
8