© 2007 by Prentice Hall1-1 Chapter 1 Introduction to Relational Database Systems and Oracle 10g Introduction to Oracle 10g James Perry and Gerald Post
© 2007 by Prentice Hall1-2 Chapter Outline Database Management Systems Describing Systems as Entities and Relationships Understanding the Relational Database model Installing Oracle tools Exploring the Oracle Environment Introduction to the Book’s Databases
© 2007 by Prentice Hall Three-tier DBMS Approach Database administrator Application developer Application user Database server Application server Forms and reports designs Table designs Forms and reports Entered data Database management systems overview
© 2007 by Prentice Hall1-4 Generic Data Types Data TypeDescriptionExamples TextAny type of characters, numbers, or most punctuation.123 Main Street NumberNumbers are stored so they can be aggregated or manipulated arithmetically. You can usually specify the number of decimal places, such as zero to get integers. Also used by Oracle to hold monetary values DateUsed to hold dates and time values. It is important to use this type instead of text when possible because the system can compute the difference between dates. 13-JUL-2006 BinaryUsed to hold data for non-traditional objects such as pictures, spreadsheet files, or other large items. Picture.jpg
© 2007 by Prentice Hall One-to-many relationship between Customer and CustomerOrder CustomerID LastName FirstName Phone Address City Customer OrderID OrderDate CustomerID CustomerOrder 1 * Database design
© 2007 by Prentice Hall Sample tables in a relational database OrderIDOrderDateCustomerID JUN JUN JUN CustomerIDLastNameFirstNamePhoneAddressCity 151JonesMary MainEureka 152SmithSusan ElmEureka 153BrownDavid EastEureka 154SanchezMaria OceanArcata 155SteubenSaul MainOrick 156HayworthMichele WestLoleta Customers CustomerOrders
© 2007 by Prentice Hall One-to-many and many-to-many relationships StudentID LastName FirstName Phone Student OrganizationID Title Advisor Category Organization OrganizationID StudentID Role Participants 1 * 1*
© 2007 by Prentice Hall Sample data showing the need for two columns to be part of the key StudentIDLastNameFirstNamePhone 12013FelliniFederico BergmanIngmar TruffautFrancois KurosawaAkiro OrganizationIDTitleAdvisorCategory 101LacrosseAmeritSports 115Phi-BetaSmithFraternity 125Student Council AntonioGovernance OrganizationIDStudentIDRole Captain Member Member President Treasurer Member Organization Student Participant
© 2007 by Prentice Hall Form data to be normalized Customer Order OrderIDDate CustomerID First NameLast Name Phone Address City, State Zipcode ItemIDPriceDescriptionQuantityValue Basketball Running shoes Racquet balls34.77 Database design starting point
© 2007 by Prentice Hall Placing all data into one table is a bad design OrderIDOrder DateCustIDFNameLNamePhoneAddressCityStateZIPItemIDPriceDescriptionQty JUN-06151MaryJones MainEurekaCA Basketball JUN-06151MaryJones MainEurekaCA Running Shoes JUN-06151MaryJones MainEurekaCA Racquet balls JUN-06155SaulSteuben MainOrickCA Basketball JUN-06155SaulSteuben MainOrickCA Baseball1
© 2007 by Prentice Hall Reducing repetition by using non-atomic columns is still bad OrderIDOrderDateCustIDFNameLNamePhoneAddressCityStateZIPItemIDPriceDescriptionQty JUN-06151MaryJones MainEurekaCA Basketball Running Shoes Racquet balls JUN-06155SaulSteuben MainOrickCA Basketball Baseball 1111
© 2007 by Prentice Hall Split out the repeating data section OrderIDOrderDateCustIDFNameLNamePhoneAddressCityStateZIP JUN-06151MaryJones MainEurekaCA JUN-06155SaulSteuben MainOrickCA95022 OrderIDItemIDPriceDescriptionQuantity Basketball Running Shoes Racquet balls Basketball Baseball1 First normal form
© 2007 by Prentice Hall Split out the columns that depend only on the ItemID OrderIDOrderDateCustIDFNameLNamePhoneAddressCityStateZIP JUN-06151MaryJones MainEurekaCA JUN-06155SaulSteuben MainOrickCA95022 OrderIDItemIDQuantity ItemIDPriceDescription Basketball Baseball Running Shoes Racquet balls ItemsOrderItems order-customer Second normal form
© 2007 by Prentice Hall Split out the columns that depend only on the CustomerID OrderIDOrderDateCustomerID JUN JUN OrderIDItemIDQuantity ItemIDPriceDescription Basketball Baseball Running Shoes Racquet balls CustomerIDFNameLNamePhoneAddressCityStateZIP 151MaryJones MainEurekaCA SaulSteuben MainOrickCA95022 Items OrderItems Orders Customers Third normal form
© 2007 by Prentice Hall Bank account example of object class inheritance AccountID CustomerID DateOpened DateClosed OpeningBalance Account MinimumBalance InterestRate MonthlyFee Checking Account InterestRate QuarterlyFee Savings Account MaxChecksPerMonth OverdraftLimit Student Checking
© 2007 by Prentice Hall Elements of the DBMS Database Administrator Operating System Disk Drives Oracle DBMS Custom Application Developer Application Users Forms and Reports Services Data Engine Data Dictionary Security PL/SQL Query Processor Admin. Tools Communication Network Developer Suite
© 2007 by Prentice Hall Oracle Basic Installation choices Installing the Oracle DBMS
© 2007 by Prentice Hall Installation success but be sure to copy the URLs
© 2007 by Prentice Hall Oracle services to be stopped Stopping Oracle with Windows services
© 2007 by Prentice Hall Oracle products to be removed Main database Forms and Reports Services Uninstalling Oracle
© 2007 by Prentice Hall Oracle registry entries to be deleted. Delete the main Oracle entry
© 2007 by Prentice Hall Specify a unique home name and path Installing Oracle Developer Suite
© 2007 by Prentice Hall Oracle network configuration
© 2007 by Prentice Hall Entering the global database name
© 2007 by Prentice Hall Copy and save the Forms and Reports Services configuration.
© 2007 by Prentice Hall Starting SQL*Plus.
© 2007 by Prentice Hall Standard login screen.
© 2007 by Prentice Hall Running the setup script
© 2007 by Prentice Hall Running a simple query with iSQL*Plus
© 2007 by Prentice Hall A simple form for the Clients table
© 2007 by Prentice Hall Sample report for Clients
© 2007 by Prentice Hall Administration tasks in the Enterprise Manager
© 2007 by Prentice Hall Diagram of the Redwood Realty database Introduction to the book’s databases
© 2007 by Prentice Hall Contact form for agents and customers
© 2007 by Prentice Hall Simple sales listing report
© 2007 by Prentice Hall Basic order form for the Coffee Merchant
© 2007 by Prentice Hall Quarterly sales organized by inventory type and state
© 2007 by Prentice Hall Race results form for Rowing Ventures
© 2007 by Prentice Hall Race results with crew names
© 2007 by Prentice Hall Order form for Broadcloth Clothing
© 2007 by Prentice Hall Shipping from factory to customer
© 2007 by Prentice Hall Factory production report