Download presentation
Presentation is loading. Please wait.
Published byDeborah Haynes Modified over 9 years ago
1
DATABASES Pindaro Demertzoglou – Lally School of Management and Technology
2
Microcomputers and applications T HE O PERATIONAL, T ACTICAL, AND S TRATEGIC A REAS OF AN ORGANIZATION Strategic Tactical Transactional/Ops
3
Microcomputers and applications 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
4
Microcomputers and applications O PERATIONS AND ORGANIZATIONAL EFFICIENCY Management in lean times and cost reduction. Corporate operations and Operating Expenses in the Income Statement The goal is to reduce inefficiency. We reduce inefficiency by reducing operating expenses. We reduce operating expenses by creating a leaner TPS system. A leaner TPS system means reduced cycle times and reduced cost. As a consequence we have reduced risk from variations in the market.
5
Microcomputers and applications T YPES OF D ATABASES According to License Type Commercial (Oracle, Microsoft SQL server, IBM DB2) Open Source (PostgreSQL) According to Network Architecture Desktop (MS Access) Client-Server (Oracle, IBM DB2, MS SQL)
6
Microcomputers and applications T HE DATABASE MARKET Let us have a look at the database market.
7
Microcomputers and applications 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)
8
Microcomputers and applications R ELATIONSHIPS One to one relationships One to many relationships Many to many relationships
9
Microcomputers and applications E NTITY R ELATIONSHIP D IAGRAM
10
Microcomputers and applications 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. Orphaned Records. With referential integrity on, we avoid orphaned records. For example, an order without a customer. However, we can have customers without orders which is a business fact.
11
Microcomputers and applications 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.
12
Microcomputers and applications I NDEXES
13
Microcomputers and applications 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.
14
Microcomputers and applications 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.
15
Microcomputers and applications 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
Microcomputers and applications 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));
17
Microcomputers and applications 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=70
18
Microcomputers and applications 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.
19
Microcomputers and applications C LASS EXERCISE Create a database entity relationship diagram of faculty, course s, and students.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.