Download presentation
Presentation is loading. Please wait.
Published byWilla Bennett Modified over 8 years ago
1
© 2007 by Prentice Hall1-1 Chapter 1 Introduction to Relational Database Systems and Oracle 10g Introduction to Oracle 10g James Perry and Gerald Post
2
© 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
3
© 2007 by Prentice Hall1-3 1.1 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
4
© 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. 1.2345 15.32 153 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
5
© 2007 by Prentice Hall1-5 1.2 One-to-many relationship between Customer and CustomerOrder CustomerID LastName FirstName Phone Address City Customer OrderID OrderDate CustomerID CustomerOrder 1 * Database design
6
© 2007 by Prentice Hall1-6 1.3 Sample tables in a relational database OrderIDOrderDateCustomerID 120106-JUN-2006151 120206-JUN-2006155 120307-JUN-2006151 CustomerIDLastNameFirstNamePhoneAddressCity 151JonesMary111-2222123 MainEureka 152SmithSusan222-5555738 ElmEureka 153BrownDavid111-2355235 EastEureka 154SanchezMaria999-3332351 OceanArcata 155SteubenSaul555-2351111 MainOrick 156HayworthMichele231-3252761 WestLoleta Customers CustomerOrders
7
© 2007 by Prentice Hall1-7 1.4 One-to-many and many-to-many relationships StudentID LastName FirstName Phone Student OrganizationID Title Advisor Category Organization OrganizationID StudentID Role Participants 1 * 1*
8
© 2007 by Prentice Hall1-8 1.5 Sample data showing the need for two columns to be part of the key StudentIDLastNameFirstNamePhone 12013FelliniFederico111-4444 12315BergmanIngmar222-3331 12551TruffautFrancois888-2221 23664KurosawaAkiro999-4491 OrganizationIDTitleAdvisorCategory 101LacrosseAmeritSports 115Phi-BetaSmithFraternity 125Student Council AntonioGovernance OrganizationIDStudentIDRole 10112013Captain 10112551Member 11512013Member 11523664President 12512551Treasurer 12512315Member Organization Student Participant
9
© 2007 by Prentice Hall1-9 1.6 Form data to be normalized Customer Order OrderIDDate CustomerID First NameLast Name Phone Address City, State Zipcode ItemIDPriceDescriptionQuantityValue 152632.95Basketball132.95 392179.92Running shoes179.92 47971.59Racquet balls34.77 Database design starting point
10
© 2007 by Prentice Hall1-10 1.7 Placing all data into one table is a bad design OrderIDOrder DateCustIDFNameLNamePhoneAddressCityStateZIPItemIDPriceDescriptionQty 120106-JUN-06151MaryJones111-2222123 MainEurekaCA95001152632.95Basketball1 120106-JUN-06151MaryJones111-2222123 MainEurekaCA95001392179.92Running Shoes1 120106-JUN-06151MaryJones111-2222123 MainEurekaCA9500147971.59Racquet balls3 120206-JUN-06155SaulSteuben555-2351111 MainOrickCA95022152632.95Basketball1 120206-JUN-06155SaulSteuben555-2351111 MainOrickCA95022314415.72Baseball1
11
© 2007 by Prentice Hall1-11 1.8 Reducing repetition by using non-atomic columns is still bad OrderIDOrderDateCustIDFNameLNamePhoneAddressCityStateZIPItemIDPriceDescriptionQty 120106-JUN-06151MaryJones111-2222123 MainEurekaCA950011526 3921 4797 32.95 79.92 1.59 Basketball Running Shoes Racquet balls 113113 120206-JUN-06155SaulSteuben555-2351111 MainOrickCA950221526 3144 32.95 15.72 Basketball Baseball 1111
12
© 2007 by Prentice Hall1-12 1.9 Split out the repeating data section OrderIDOrderDateCustIDFNameLNamePhoneAddressCityStateZIP 120106-JUN-06151MaryJones111-2222123 MainEurekaCA95001 120206-JUN-06155SaulSteuben555-2351111 MainOrickCA95022 OrderIDItemIDPriceDescriptionQuantity 1201152632.95Basketball1 1201392179.92Running Shoes1 120147971.59Racquet balls3 1202152632.95Basketball1 1202314415.72Baseball1 First normal form
13
© 2007 by Prentice Hall1-13 1.10 Split out the columns that depend only on the ItemID OrderIDOrderDateCustIDFNameLNamePhoneAddressCityStateZIP 120106-JUN-06151MaryJones111-2222123 MainEurekaCA95001 120206-JUN-06155SaulSteuben555-2351111 MainOrickCA95022 OrderIDItemIDQuantity 120115261 120139211 120147973 120215261 120231441 ItemIDPriceDescription 152632.95Basketball 314415.72Baseball 392179.92Running Shoes 47971.59Racquet balls ItemsOrderItems order-customer Second normal form
14
© 2007 by Prentice Hall1-14 1.11 Split out the columns that depend only on the CustomerID OrderIDOrderDateCustomerID 120106-JUN-06151 120206-JUN-06155 OrderIDItemIDQuantity 120115261 120139211 120147973 120215261 120231441 ItemIDPriceDescription 152632.95Basketball 314415.72Baseball 392179.92Running Shoes 47971.59Racquet balls CustomerIDFNameLNamePhoneAddressCityStateZIP 151MaryJones111-2222123 MainEurekaCA95001 155SaulSteuben555-2351111 MainOrickCA95022 Items OrderItems Orders Customers Third normal form
15
© 2007 by Prentice Hall1-15 1.12 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
16
© 2007 by Prentice Hall1-16 1.13 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
17
© 2007 by Prentice Hall1-17 1.14 Oracle Basic Installation choices Installing the Oracle DBMS
18
© 2007 by Prentice Hall1-18 1.15 Installation success but be sure to copy the URLs
19
© 2007 by Prentice Hall1-19 1.16 Oracle services to be stopped Stopping Oracle with Windows services
20
© 2007 by Prentice Hall1-20 1.17 Oracle products to be removed Main database Forms and Reports Services Uninstalling Oracle
21
© 2007 by Prentice Hall1-21 1.18 Oracle registry entries to be deleted. Delete the main Oracle entry
22
© 2007 by Prentice Hall1-22 1.19 Specify a unique home name and path Installing Oracle Developer Suite
23
© 2007 by Prentice Hall1-23 1.20 Oracle network configuration
24
© 2007 by Prentice Hall1-24 1.21 Entering the global database name
25
© 2007 by Prentice Hall1-25 1.22 Copy and save the Forms and Reports Services configuration.
26
© 2007 by Prentice Hall1-26 1.23 Starting SQL*Plus.
27
© 2007 by Prentice Hall1-27 1.24 Standard login screen.
28
© 2007 by Prentice Hall1-28 1.25 Running the setup script
29
© 2007 by Prentice Hall1-29 1.26 Running a simple query with iSQL*Plus
30
© 2007 by Prentice Hall1-30 1.27 A simple form for the Clients table
31
© 2007 by Prentice Hall1-31 1.28 Sample report for Clients
32
© 2007 by Prentice Hall1-32 1.29 Administration tasks in the Enterprise Manager
33
© 2007 by Prentice Hall1-33 1.30 Diagram of the Redwood Realty database Introduction to the book’s databases
34
© 2007 by Prentice Hall1-34 1.31 Contact form for agents and customers
35
© 2007 by Prentice Hall1-35 1.32 Simple sales listing report
36
© 2007 by Prentice Hall1-36 1.33 Basic order form for the Coffee Merchant
37
© 2007 by Prentice Hall1-37 1.34 Quarterly sales organized by inventory type and state
38
© 2007 by Prentice Hall1-38 1.35 Race results form for Rowing Ventures
39
© 2007 by Prentice Hall1-39 1.36 Race results with crew names
40
© 2007 by Prentice Hall1-40 1.37 Order form for Broadcloth Clothing
41
© 2007 by Prentice Hall1-41 1.38 Shipping from factory to customer
42
© 2007 by Prentice Hall1-42 1.39 Factory production report
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.