1 / 58

Databaser

Databaser. Chapter Six Overview SECTION 6.1 – DATABASE FUNDAMENTALS Understanding Information Database Fundamentals Database Advantages Relational Database Fundamentals Database Management Systems Integrating Data Among Multiple Databases SECTION 6.2 – DATA WARAEHOUSE FUNDAMENTALS

andres
Télécharger la présentation

Databaser

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Databaser Chapter Six Overview • SECTION 6.1 – DATABASE FUNDAMENTALS • Understanding Information • Database Fundamentals • Database Advantages • Relational Database Fundamentals • Database Management Systems • Integrating Data Among Multiple Databases • SECTION 6.2 – DATA WARAEHOUSE FUNDAMENTALS • Accessing Organizational Information • History of Data Warehousing • Data Warehouse Fundamentals • Business Intelligence • Data Mining

  2. Understanding information • Information is everywhere in an organization • Employees must be able to obtain and analyze the many different levels, formats, and granularities of organizational information to make decisions • Successfully collecting, compiling, sorting, and analyzing information can provide tremendous insight into how an organization is performing Kunskap och information har ett värde Kostnad för att byta ut en skruv 1.101 kr Skruven1 kr Arbetskostnad100 kr Kunskap och information om arbetet1.000 kr

  3. Understanding information • Information granularity – refers to the extent of detail within the information (fine and detailed or coarse and abstract) • Levels • Formats • Granularities

  4. Information Quality • Business decisions are only as good as the quality of the information used to make the decisions • Characteristics of high quality information include: • AccuracyKorrekt? • CompletenessSaknas något? • ConsistencyHänger det ihop? Är det logiskt? • UniquenessDubellagrar vi information? Kan vi komma åt information direkt? • TimelinessÄr informationen aktuell? + Är informationen spårbar

  5. Information Quality • Low quality information example

  6. Understanding the Costs of Poor Information • The four primary sources of low quality information include: • Online customers intentionally enter inaccurate information to protect their privacy • Information from different systems have different entry standards and formats • Call center operators enter abbreviated or erroneous information by accident or to save time • Third party and external information contains inconsistencies, inaccuracies, and errors

  7. Understanding the Costs of Poor Information • Potential business effects resulting from low quality information include: • Inability to accurately track customers • Difficulty identifying valuable customers • Inability to identify selling opportunities • Marketing to nonexistent customers • Difficulty tracking revenue due to inaccurate invoices • Inability to build strong customer relationships

  8. Konceptuell modellering • Objekt • Relationer • Egenskap • Entiteter

  9. Objekt Intressanta företeelser Konkreta Abstrakta 7 • Icke existerande • Evighetsmaskin • Cirkelns kvadratur

  10. Relationer • Relationerbeskriversambandmellanobjekt Har_far äger Gift_med Har_mor

  11. Mängder/klasser & Attribut • Gruppering av • liknande objekt reg. no model year colour name age salary hair colour

  12. married to owns Example Conceptual Model PERSON CAR name age salary hair colour reg.no. model year colour

  13. Tabeller/filer och databaser Artiklar Tabell (Register, File, Fil) Kolumn (Attribute, field, fält) Art.nrNamnPrisLagerAntal 1Skruv1.501.000 2Mutter1.20300 3Bricka0.50850 Rad (Record, Post) DATABAS = Alla tab. Och relationer Operationer från program Ny artikel (4, Spik, 0.70, 0) Nytt pris (1, 1.60) Antal i lager (2) Ta bort (3) ARTIKLAR BESTÅR-AV LEVERERAR INGÅR -I Vilka artiklar har kund nr 51 köpt det senaste året ? LEVERANTÖRER ORDER HAR KUNDER

  14. Olika typer av tabeller REGISTER ANVÄNDNING PERSON KUND ARTIKEL BOKNINGS LÄKEMEDELS löneberäkning fakturering lagerhållning fakturering tid- och platsbokning recept

  15. Undvik klassificerande ID-begrepp De spricker ofta ex xxxxx xx xxx Vilken bonus har jag ? Typ av sko Storlek Färgkod Vilket är Ditt försäkringsnummer ?? Nyckel/ Primary Key Unikt sökbegrepp i ett register: Primärnyckel, ID-begrepp EX Personnummer i ett personregister: PersNr, Namn, Adress, Lön Kundnummer i ett kundregister: KundNr, Namn, Rabatt, Kategori

  16. En övning GUTE CYKELUTHYRNING på soliga Gotland har4.500 cyklar till uthyrning. Administrationen har har blivit så betungande att man beslutat att anskaffa en PC. Vi skall nu konstruera systemet åt dem. Vi börjar med databasen. Det grundläggande är att varje cykel har ett ingraverat ramnummer. I samband med uthyrning betalar man en depositionsavgift som varierar mellan olika cyklar. Vid återlämningen skall systemet skriva ut ett specificerat kvitto. Kostnaden är cykelns dagspris gånger antalet dagar. Naturligtvis skall cykelregistret uppdateras vid exempelvis nyanskaffning. Två listor skall kunna tas fram: 1. Cyklar som just nu är uthyrda. Skall framgå vem som hyr. 2. En totallista över samtliga cyklar som skall uppta anskaffningsår och hur många dagar den totalt varit uthyrd sen anskaffningen. UPPGIFT: Gör en postbeskrivning för cykelregistret, vilket skall vara det enda förekommande registret.

  17. Relationer i en databas Fall 1 (ett till ett) En fastighet kan bara ägas av en person och en person kan bara äga en fastighet person PNR ** NAMN ADRESS FNR* fastighet FNR ** KOMMUN PRIS PNR* Fall 2 (ett till många) En person kan äga fler fastigheter men en fastighet kan bara ha en ägare person PNR ** NAMN ADRESS fastighet FNR ** KOMMUN PRIS PNR* Fall 3 (många till många) En person kan äga fler fastigheter och en fastighet kan ha fler delägare person PNR ** NAMN ADRESS fastighet FNR ** KOMMUN PRIS ** Primärnyckel * Sekundärnyckel, referens

  18. Exempel på relationer 1 - M ** ** * PNR NAMN ADR FNR KOMMUN PRIS PNR 1 KALLE A-GATAN A STHLM 1.000 1 2 PELLE B-GATAN B GBG 2.000 3 NISSE C-GATAN C MALMÖ 1.500 1 4 ULLA D-GATAN D LUND 5.000 4 PERSON FASTIGHET

  19. M - M kräver ett relationsobjekt person PNR ** NAMN ADRESS fastighet FNR ** KOMMUN PRIS ägarför- hållande PNR* FNR* % ANDEL 1 KALLE A-Gatan. 1 A 100 A STHLM 1.000 2 PELLE B-Gatan 1 D 50 B GBG 2.000 3 NISSE C-Gatan 4 D 50 C MALMÖ 1.000 4 ULLA D-Gatan D LUND 2.000 Kalle äger hela A och halva D Ulla äger halva D

  20. Kopplingstabell - Ytterligare ett exempel Person Företag Person Anställning Företag Pnr Fnr Lön Pnr Namn Fnr Namn Namn Adress Pnr Namn 1 Kalle 2 Pelle 3 Stina 4 Lisa A ABB B HM C Univ. D Ericsson A ABB B HM C Univ. D Ericsson 1 Kalle 2 Pelle 3 Stina 4 Lisa 1 A 10.000 2 A 20.000 1 B 30.000 3 C 15.000 LÖN ????

  21. Increased Flexibility • A well-designed database should: • Handle changes quickly and easily • Provide users with different views • Have only one physical view • Physical view – deals with the physical storage of information on a storage device • Have multiple logical views • Logical view – focuses on how users logically access information

  22. Increased Scalability and Performance • A database must scale to meet increased demand, while maintaining acceptable performance levels • Scalability – refers to how well a system can adapt to increased demands • Performance – measures how quickly a system performs a certain process or transaction

  23. Reduced Redundancy • Databases reduce information redundancy • Redundancy – the duplication of information or storing the same information in multiple places • Inconsistency is one of the primary problems with redundant information

  24. Increased Security • Information is an organizational asset and must be protected • Databases offer several security features including: • Password – provides authentication of the user • Accesslevel – determines who has access to the different types of information • Accesscontrol – determines types of user access, such as read-only access

  25. Potential relational database for Coca-Cola Primary Key Foreign Key

  26. Operationer mot ett register Pull Ad Hoc eller fördefinierade frågor LÄSA EN ELLER FLER POSTER SELEKTERA UPPDATERA/ AKTUALISERA FÖRSÄKRINGAR ALLA ARTIKLAR SOM BÖRJAR PÅ S 1 SKRUV 5 SKIVA FÖRSNR 7 ALLA FÖRSÄKRINGAR NY KUND TA BORT KUND ADRESSÄNDRING Push MATCHA SORTERA PERS.REG PERS.REG F-KASSA BOSTADSBIDRAG Motor NR ART 1 SKRUV 2 MUTTER 3 VINKEL 4 BRÄDA 5 SKIVA NR ART 4 BRÄDA 2 MUTTER 5 SKIVA 1 SKRUV 3 VINKEL JFR INKOMST UPPGIFTER Hastighets- mätare

  27. Database management systems • Database management systems (DBMS) – software through which users and application programs interact with a database

  28. Database management systems • Four components of a DBMS

  29. Data Definition Component • Data dictionary essentially defines the logical properties of the information that the database contains

  30. Data Manipulation Component • Data manipulation component – allows users to create, read, update, and delete information in a database • A DBMS contains several data manipulation tools: • View – allows users to see, change, sort, and query the database content • Reportgenerator – users can define report formats • Query-by-example (QBE) – users can graphically design the answers to specific questions • Structured query language (SQL) – query language

  31. Data Manipulation Component • Sample report using Microsoft Access Report Generator

  32. Data Manipulation Component • Sample report using Access Query-By-Example (QBE) tool

  33. Data Manipulation Component • Results from the query in Figure 6.10

  34. SQL Structured Query Language Kommandon i program som används för data- åtkomst & manipulation Lägga in ny data INSERT person Ändra dataUPDATE adress Radera data DELETE person Hämta data SELECT alla personer som är födda i Vingåker och som varit stadsministrar mfl

  35. SQL-exempel INSERT INTO Medlem (medlemsnr, fnamn, enamn, gadr, lön) VALUES (10004, ’Anna’, ’Andersson’, ’Kungsgatan 3’, ’40.000’); DELETE Medlem WHERE medlemsnr = 10005; UPDATE Medlem SET gadr = ’Byggvägen 3’ WHERE medlemsnr = 10004; SELECT fnamn, enamn FROM Medlem WHERE lön > 1.000.000 ;

  36. SQL – lite mer avancerat KUND-TABELLORDER-TABELL KundNrOrderNr KundNamnKundNr KundKategoriOrderBelopp SELECT KUNDNAMN, ORDERNR FROM KUND-TABELL, ORDER-TABELL WHERE ORDERBELOPP > 10.000 AND KUNDKATEGORI = 7 OR 11<--- villkor AND KUND-TABELL.KundNr = ORDER-TABELL.KundNr <--- join SORT BY KUNDNAMN Resulterar i KundNamnnOrderNr Abelén4711 Adolfsson193 Bengtsson10.023 ………..

  37. Application Generation and Data Administration Components • Application generation component – includes tools for creating visually appealing and easy-to-use applications • Data administration component – provides tools for managing the overall database environment by providing faculties for backup, recovery, security, and performance • IT specialists primarily use these components

  38. Integrating data among multiple databases • Integration – allows separate systems to communicate directly with each other • Forward integration – takes information entered into a given system and sends it automatically to all downstream systems and processes • Backward integration – takes information entered into a given system and sends it automatically to all upstream systems and processes

  39. Integrating dataamong multiple databases • Forward and backward integration

  40. Integrating dataamong multiple databases • Building a central repository specifically for integrated information

  41. Att integrera system Företag A Regler System B1 System A1 Logg System A2 System B2 System A3 Systeminegrator System B3 Företag B Format Tidpunkter Regler/Kontroller Historik Backup m.m. System C1 Istället för att bygga om de olika systemen System C2 Företag C

  42. Övning i datamodellering FAKTURA BILVERKSTADEN AB uppdrag-nr 1 kund-nr 2 namn Olle adress O-gatan faktnr 2453 regnr ABC123 datum 95-01-10 Arbeten (Fördefinierade) Antal 1 st Summa 1.ooo kr Á-pris 1.000 kr Nr A1 Namn Byta avgasrör Material (Fördefinierade) Á-pris 500 kr 10 kr 1 kr 2 kr Antal 1 st 2 st 4 st 4 st Summa 500 kr 20 kr 4 kr 8 kr Nr M1 M2 M3 M4 Namn Avgasrör Fäste Skruv Mutter summa 532 kr moms 133 kr att betala 1.665 kr Gör en datamodell för denna verksamhet

  43. Lösning UPPDRAG UNR** KNR* DATUM REGNR FAKTNR KUND KNR** NAMN ADRESS 1 M MATERIAL MNR** NAMN À-PRIS 1 ARBETEN I UPPDRAG UNR* ANR* ANTAL 1 1 M M M MATERIAL I UPPDRAG UNR* MNR* ANTAL M 1 ARBETEN ANR** NAMN À-PRIS

  44. Lösning, forts KUNDKNRNAMNADRESS 1KALLEK-GATAN 2OLLEO-GATAM 3ULLAU-GATAN 4SIVS-GATAN 5INGVARI-GATAN UPPDRAGUNRKNRDATUMREGNRFAKTNR 0012950110ABC1232453 0024950111XYZ7892454 ARBETENANRNAMNÁ-PRIS A1BYTA AVGASRÖR1.000 A2BYTA TÄNDSTIFT200 A3SERVICE1.500 A4MOTORTVÄTT600

  45. Lösning, forts MATERMNRNAMNÁ-PRISD M1AVGASRÖR500 M2FÄSTE10 M3SKRUV1 M4MUTTER2 M5TÄNDSTIFT10 M6TVÄTTMEDEL100 ARBETENUNRANRANTAL I UPPDR.001A11 002A41 MATRUNRMNRANTAL I UPPDR001M11 001M22 001M34 001M44 002M61

  46. 6.2. DATA WAREHOUSE FUNDAMENTALS • Data warehouses extend the transformation of data into information • In the 1990’s executives became less concerned with the day-to-day business operations and more concerned with overall business functions • The data warehouse provided the ability to support decision making without disrupting the day-to-day operations

  47. Data warehouse fundamentals • Data warehouse – a logical collection of information – gathered from many different operational databases – that supports business analysis activities and decision-making tasks • The primary purpose of a data warehouse is to aggregate information throughout an organization into a single repository for decision-making purposes

  48. Data Warehouse

  49. Data warehouse fundamentals • Extraction, transformation, and loading (ETL) – a process that extracts information from internal and external databases, transforms the information using a common set of enterprise definitions, and loads the information into a data warehouse • Data mart – contains a subset of data warehouse information

  50. Data warehouse fundamentals

More Related