Download presentation
Presentation is loading. Please wait.
Published byClarence Sanders Modified over 8 years ago
1
Data Resource Management Application Layer TPS A RCHITECTURE Data Layer Sales/MarketingHR Finance/Accounting Operations Spreadsheet Data MS Access Accounts Receivable Accounts Payable Investment Management Oracle Database Quotation Processing Order Processing Claims Processing Spreadsheet Oracle Database Foxpro Recruiting Career Planning Compensation Management Excel Production Planning Product Development Maintenance Planning Oracle Excel Oracle
2
Data Resource Management W HY DATABASES Multiple people in the organization need to access and work on the same data. Work in database parlance means insert/edit/delete data. Data volume increases over time. Are the pieces of data related? Like customers to orders, to products, to order contents, to invoices, to suppliers, to sales people? Do you need to extract information out of your data? (summaries, totals, averages, etc.) Do you need subsets of data? (customers in NY and CA only for example?) Do you need to cooperate with external entities?
3
Data Resource Management T YPES OF D ATABASES According to Data Model Relational Hierarchical An example of a hierarchical file is an XML file. According to License Type Commercial Open Source According to Network Architecture Desktop (MS Access) Client-Server (Oracle, IBM DB2, MS SQL)
4
Data Resource Management M ARKET S HARE Gartner Study Shows Strong Growth in the DBMS Market - 2008
5
Data Resource Management D ATABASE T ABLES Tables (entities) Fields (Attributes) Data types (text, number, Currency, Binary) Data types Records (A group of related fields) Keys Primary Foreign One-field keys Concatenated keys Natural keys Surrogate keys (Artificial)
6
Data Resource Management R ELATIONSHIPS One to one relationships One to many relationships Many to many relationships
7
Data Resource Management E NTITY R ELATIONSHIP D IAGRAM
8
Data Resource Management R EFERENTIAL INTEGRITY Referential integrity in relational databases means that relationships among joined tables remain consistent. That is, if we have a one-to-many relationship between customers and orders: We cannot delete a customer for whom we have orders. We cannot add an order without having a customer. We can have however customers without orders. With referential integrity on, we avoid orphaned records.
9
Data Resource Management I NDEXES Indexes improve data retrieval. They work great with WHERE and ORDER BY clauses. Indexes slow down data inserts and updates since updates and inserts need to be saved at both the table and the index. Increase storage requirements. Unique indexes can be used as constraints. Avoid their usage in small tables with few records. Better used in large tables. All primary key fields are automatically indexed when created. We can also have multiple-field indexes.
10
Data Resource Management I NDEXES
11
Data Resource Management N ORMALIZATION A two-aim process: Redundancy (Elimination of duplicated data) Inconsistent Dependency (Data should be related to entities ie. Orders must be in a separate table rather than in the customer table) First Normal Form ( Do not use multiple fields in a table to store similar data. Ie. five fields in an inventory table to identify vendors. What happens if we add a new vendor?) Second Normal Form ( Do not store the same data in multiple tables. Ie An address is needed in the customer’s table, shipping, billing etc.) create a separate table for addresses. Third Normal Form ( Exclude from the table fields that do not depend on the key ie For example instead of storing the zip code in the address table that you created above you create a separate table for zip codes.) Not always practical. Remember: business rules have priority.
12
Data Resource Management C ASCADE UPDATES AND DELETES Cascade deletes allow us to delete an entity record and all associated information to that entity record. For example, if cascade deletes are on between the tables customers and orders, then when we delete a customer, all related orders will be deleted by the database engine. Cascade updates let us update all primary keys of an entity and their related foreign keys in all related tables. For example, if cascade updates are on between the tables customers and orders, then when we update the PK value of a customer, all related foreign keys of that customer in the table orders will be updated by the database engine.
13
Data Resource Management SQL Language Data Definition Language Data Manipulation Language CREATE TABLE Customer1 ( [CustomerID] Counter PRIMARY KEY NOT NULL, [LastName] text(50) NOT NULL, [FirstName] text(50), [Address] text(50));
14
Data Resource Management SQL L ANGUAGE (D ATA MANIPULATION LANGUAGE ) Select statements Example: Select * from products Insert statements Example: Insert into products (productname, unitprice) values (“myproduct”, 22) Update statements Example: update products set unitprice = unitprice*1.2 Delete statements Example: Delete from products where productID=10269
15
Data Resource Management Q UERIES SQL statements through which we can select, delete, insert, and update data. With queries we obtain a subset of attributes, or a subset of records, or a subset of attributes and records. They can function as a security mechanism so that end users do not have direct access to tables. Views can present data from multiple different related tables in a simplified datasheet. Queries can aggregate data for information generation. Views do not consume any space, we just store the SQL statement which we can execute at any moment.
16
Data Resource Management D ATA D ICTIONARIES They are used for development purposes and they consist of a spreadsheet that includes the names of the fields and a description of their purpose in the database.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.