Академический Документы
Профессиональный Документы
Культура Документы
5.1 3.1
Table
Relational database Database Management system (DBMS) Field Field data types
Record
Primary key / Foreign key
3.2
DATA BASE
Database - Is an organized collection of related information about any subject. - A DB does not have to be kept on a computer. - For example, telephone directory, train timetable, etc. These are all examples of paper based DB. - One of the most successful databases in modern history is the telephone book. The telephone book is a collection of records on people and businesses who have telephones. The telephone book lists four pieces of information for each phone user: last name, first name, address, and phone number. It also contains information on businesses and business categories, such as auto dealers or plumbing suppliers. Prior to the development of digital databases, a business would use large filing cabinets filled with paper files. You can still find paper-based manual databases in most doctors offices where patient records are stored in thousands of paper files.
3.3
2007 by Prentice Hall
The Database Approach to Data Management Needless to say, paper-based databases are extremely inefficient and costly to maintain, often contain inaccurate data, are slow, and make it difficult to access the data in a timely fashion.
Why use an electronic DB? - Storing DB on a computer Electronic DB, enables you to manipulate large quantities of information easily updating, flexibly, quickly, easy searching, DB sharing, etc.
5.3 3.4
Foreign key
A field (or combination of fields) in a database record that is used as a primary key for another table.
Relational Database
Databases are made up of a number of related tables.
Database
Is an organized collection of related Files / information about any subject.
3.6
Database Pyramid
- DB holds tables. - Tables hold a number of records. - Each record has a number of fields. - A field contains data and has a data type and a picture.
3.7
2007 by Prentice Hall
3.8
Cust name Contact pers. Tel. Address Hilton Hotel Noha 123 abcdefgh Mereidian Kareem 456 adasdsd Maryott Mirna 987 bnvccvbv contains all orders details. Ord date 1/1/2013 1/1/2013 8/1/2013 15/1/2013 Required date 1/1/2013 5/1/2013 14/1/2013 25/1/2013 Quantity Item 100 Pepsi 40 Cake 70 7up 10 Milk
2007 by Prentice Hall
Orders Table;
Cust ID HLT MRD HLT MRT
This greatly:
Minimizes the size of our DB. Enhance the response time of the DB application. Minimizes the work involved in entering new records. Minimizes the work involved in editing existing records.
3.10
Typically, youll be using data about focus points such as customers, suppliers, employees, orders, products, shippers, and perhaps parts.
Each of these generalized categories representing a person, place, or thing on which we store and maintain information is called an entity.
Each entity has specific characteristics, called attributes. For example, the entity SUPPLIER has specific attributes, such as the suppliers name and address.
5.5 3.11
2007 by Prentice Hall
The actual information about a single supplier that resides in a table is called a row. Rows are commonly referred to as records. 5.8 3.12
2007 by Prentice Hall
The Database Approach to Data Management Organizing Data in a Relational Database So far the SUPPLIER table doesnt have any information about the parts that a particular supplier provides for your company. PART is a separate entity from SUPPLIER, and
5.12 3.14
5.14 3.15
Notice that Supplier_Number appears in both the SUPPLIER and PART tables. In the SUPPLIER table, Supplier_Number is the primary key. When the field Supplier_Number appears in the PART table it is called a foreign key. Note that the PART table would itself have its own primary key field, Part_Number, to uniquely identify each part.
5.13 3.16
The Database Approach to Data Management Organizing Data in a Relational Database As we organize data into tables, its important to make sure that all the attributes for a particular entity apply only to that entity.
5.18 3.17
The Database Approach to Data Management Establishing Relationships Now that weve broken down our data into a SUPPLIER table and a PART table, we must make sure we understand the relationship between them. An entity-relationship diagram is used to clarify table relationships in a relational database. The most important piece of information provided by an entityrelationship diagram is the manner in which two tables are related to each other. Tables in a relational database may have one-to-one, one-to-many, and many-to-many relationships.
5.19 3.18
2007 by Prentice Hall
This diagram shows the relationship between the entities SUPPLIER and PART.
Figure 5-3
2007 by Prentice Hall
5.23 3.19
Database Management System Now that youve started creating the files and identifying the data required by your business, youll need a database management system to help you manage and use the data. A database management system (DBMS) is a specific type of software for creating, storing, organizing, and accessing data from a database.
5.36 3.20
Database Management System Microsoft Access is a DBMS for desktop systems, whereas DB2, Oracle Database, and Microsoft SQL Server are DBMS for large mainframes and midrange computers. MYSQL is a popular DBMS, and Oracle Database Lite is a DBMS for small handheld computing devices. All of these products are relational DBMS that support a relational database.
5.37 3.21
Database Management System The DBMS relieves the end user or programmer from the
5.39 3.23
A payroll department member might need data such as the employees name, social security number, gross pay, and net pay. The data for all of
5.40 3.24
A single human resources database provides many different views of data, depending on the information requirements of the user. Illustrated here are two possible views, one of interest to a benefits specialist and one of interest to a member of the companys payroll department.
Figure 5-7
2007 by Prentice Hall
5.41 3.25
Database Management System Capabilities of Database Management Systems Querying and Reporting Most DBMS have a specialized language called a data manipulation language that is used to add, change, delete, and retrieve the data in the database. This language contains commands that permit end users and programming specialists to extract data from the database to satisfy information requests and develop applications. The most prominent data manipulation language today is Structured Query Language, or SQL.
5.52 3.26
2007 by Prentice Hall
Illustrated here are the SQL statements for a query to select suppliers for parts 137 or 150. They produce a list with the same results as Figure 5-8.
Figure 5-10
2007 by Prentice Hall
5.54 3.27
Database Management System Object-Oriented Databases Many applications today and in the future require databases
that can store and retrieve not only structured numbers and
characters but also drawings, images, photographs, voice, and full-motion video. DBMS designed for organizing structured data into rows and columns are not well suited to handling graphics-based or multimedia applications.
Object-oriented databases are better suited for handling graphics-based or multimedia applications.
5.61 3.28
2007 by Prentice Hall
Hybrid object-relational DBMS are now available to provide capabilities of both object-oriented and relational DBMS.
5.63 3.29