Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Ensuring Database IntegrityEntity IntegrityExamples of Entity IntegrityEnforcing IntegrityReferential IntegritySlide 20Using SQL- Structured Query LanguageSQL ExamplesData RetrievalUPDATE tablesDatabase NormalizationNormalizationEx: Database Normalization (1)Ex: Database Normalization (2)Ex: Database Normalization (3)Ex: Database Normalization (4)Ex: Database Normalization (5)The Normal FormsFirst Normal Form (1NF)Second Normal Form (2NF)Third Normal Form (3NF)Slide 36What is a Data Warehouse?Slide 38Data MiningDW CharacteristicsData AcquisitionData CleansingDATA DATA RESOURCERESOURCEMANAGEMENTMANAGEMENTData Hierarchy in a Computer SystemEntitities and AttributesData redundancyProgram-Data dependenceLack of flexibilityPoor securityLack of data-sharing and availabilityProblems with the Traditional File EnvironmentTraditional File ProcessingFigure 7-3•Creates and maintains databasesCreates and maintains databases•Eliminates requirement for data definition Eliminates requirement for data definition statementsstatements•Acts as interface between application Acts as interface between application programs and physical data filesprograms and physical data files•Separates logical and physical views of dataSeparates logical and physical views of dataDatabase Management System (DBMS)The Contemporary Database EnvironmentComponents of DBMS•Data definition language: Data definition language: Specifies Specifies content and structure of database and content and structure of database and defines each data elementdefines each data element•Data manipulation language:Data manipulation language:Manipulates data in a databaseManipulates data in a database•Data dictionary:Data dictionary: Stores definitions of Stores definitions of data elements, and data characteristicsdata elements, and data characteristicsSample Data Dictionary ReportFigure 7-6Relational Data ModelThree Basic Operations in a Relational Database•Select:Select: Creates subset of rows that meet Creates subset of rows that meet specific criteriaspecific criteria•Join:Join: Combines relational tables to provide Combines relational tables to provide users with informationusers with information•Project:Project: Enables users to create new tables Enables users to create new tables containing only relevant informationcontaining only relevant informationFigure 7-7Three Basic Operations in a Relational DatabaseFLAT FILE – NOT NORMALIZEDA Normalized Relation of ORDEREnsuring Database IntegrityDatabase integrity involves the maintenance of the logical and business rules of the database.There are two kinds of “DB Integrity” that must be addressed:Entity IntegrityReferential IntegrityEntity IntegrityEntity integrity deals with within-entity rules.These rules deal with ranges and the permission of null values in attributes or possibly between recordsExamples of Entity IntegrityData Type Integrity: very common and most basic. Checks only for “data type” compatibility with DB Schema, such as: numeric, character, logical, date format, etc.Commonly referred to in GIS manuals as:Range and List domainsRanges - acceptable Numeric ranges for inputList - acceptable text entries or drop-down lists.Enforcing IntegrityNot a trivial task!Not all database management systems or GIS software enable users to “enforce data integrity” during attribute entry or edit sessions.Therefore, the programmer or the Database Administrator must enforce and/or check for “Integrity.”Referential IntegrityReferential integrity concerns two or more tables that are related.Example: IF table A contains a foreign key that matches the primary key of table B THEN values of this foreign key either match the value of the primary key for a row in table B or must be null.Necessary to avoid: Update anomaly, Delete anomaly.Basic SQL CommandsSELECT: Specifies columns FROM: Identifies tables or viewsWHERE: Specifies conditions Querying Databases: Elements of SQLUsing SQL- Structured Query LanguageSQL is a standard database protocol, adopted by most ‘relational’ databasesProvides syntax for data:Definition RetrievalFunctions (COUNT, SUM, MIN, MAX, etc)Updates and DeletesSQL ExamplesCREATE TABLE SALESREPItem definition expression(s){item, type, (width)}DELETE tableWHERE expressionData RetrievalSELECT list FROM table WHERE conditionlist - a list of items or * for all itemsWHERE - a logical expression limiting the number of records selectedcan be combined with Boolean logic: AND, OR, NOTORDER may be used to format resultsUPDATE tablesSET item = expressionWHERE expressionINSERT INTO tableVALUES …..Database NormalizationNormalization: The process of structuring data to minimize duplication and inconsistencies. The process usually involves breaking down a single Table into two or more tables and defining relationships between those tables. Normalization is usually done in stages, with each stage applying more rigorous rules to the types of information which can be stored in a table.NormalizationNormalization: a process for analyzing the design of a relational databaseDatabase Design - Arrangement of attributes into entitiesIt permits the identification of potential problems in your database designConcepts related to Normalization:KEYS and FUNCTIONAL DEPENDENCEEx: Database Normalization (1)Sample Student Activities DB TablePoorly DesignedNon-unique recordsJohn SmithTest the Design by developing sample reports and queriesCreated a unique “ID” for each Record in the Activities TableRequired the creation of an “ID” look-up table for reporting (Students Table)Converted the “Flat-File into a Relational DatabaseEx: Database Normalization (2)Ex: Database Normalization (3)Wasted SpaceRedundant data entryWhat about taking a 3rd Activity?Query Difficulties - trying to find all swimmersData Inconsistencies - conflicting pricesEx: Database Normalization (4)Students table is fineElimination of two columns and an Activities Table restructuring, Simplifies the TableBUT, we still have Redundant data (activity fees) and data insertion anomalies.Problem: If student #219 transfers we lose all references to Golf and its price.Ex: Database Normalization


View Full Document

USF ACG 6936 - DATA RESOURCE MANAGEMENT

Download DATA RESOURCE MANAGEMENT
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view DATA RESOURCE MANAGEMENT and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view DATA RESOURCE MANAGEMENT 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?