Geo-Databases: lecture 7 Database design

Slides:



Advertisements
Similar presentations
Relational Database and Data Modeling
Advertisements

Technology Guide 3 Data and Database T3-1. IT for Management Prof. Efraim Turban T3-2 File Management Hierarchy of data for a computer-based file Record.
Feb 4: Recap of Jan 30 class Data Models: E-R and Relational (and some others of mostly historical interest) We examined the E-R model –Entities, Relationships,
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 6 Advanced Data Modeling.
Database Design (Data Modeling) DCO11310 Database Systems and Design By Rose Chang.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Database Design & ER Diagrams
Overview of the Database Development Process
DATABASE MANAGEMENT SYSTEMS BASIC CONCEPTS 1. What is a database? A database is a collection of data which can be used: alone, or alone, or combined /
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
Software School of Hunan University Database Systems Design Part III Section 5 Design Methodology.
CSCI 3140 Module 2 – Conceptual Database Design Theodore Chiasson Dalhousie University.
Department of Geoinformation Science Technische Universität Berlin WS 2006/07 Geoinformation Technology: lecture 3 Mapping of OO Models onto Tables Prof.
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
Week 4-5 DBMS Database Design. Database design process can be divided into 6 major steps: 1.Requirements Analysis 2.Conceptual Database Design 3.Logical.
Object storage and object interoperability
Department of Geoinformation Science Technische Universität Berlin WS 2006/07 Geoinformation Technology: lecture 2 (b) Object Modeling Prof. Dr. Thomas.
Copyright © 2014 Pearson Canada Inc. 5-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5a Database Design Part 2: Using Information Technology.
April 20022/CS/3X1 Database Design Design method John Wordsworth Department of Computer Science The University of Reading Room.
COP Introduction to Database Structures
Database Development Lifecycle
Methodology Conceptual Databases Design
Entity- Relationship (ER) Model
TMC2034 Database Concept and Design
Datab ase Systems Week 1 by Zohaib Jan.
Entity Relationship (E-R) Modeling
Methodology Conceptual Database Design
Tables and Their Characteristics
Chapter 7: Entity-Relationship Model
Lecture 2 The Relational Model
Methodology – Physical Database Design for Relational Databases
Physical Database Design for Relational Databases Step 3 – Step 8
Chapter 4 Relational Databases
Conceptual data modeling
Translation of ER-diagram into Relational Schema
Databases and Information Management
Advanced Database Models
CS 174: Server-Side Web Programming February 12 Class Meeting
Chapter 9 Designing Databases
From ER to Relational Model
MANAGING DATA RESOURCES
File Systems and Databases
Module 8 – Database Design Using the E-R Model
.NET Database Technologies:
Session 2 Welcome: The seventh learning sequence
Geo-Databases: lecture 2 The Relational Data Model
The Entity-Relationship Model
Need for the subject.
Database Systems: Design, Implementation, and Management Ninth Edition
Databases and Information Management
Chapter 5 Advanced Data Modeling
CHAPTER 1: THE DATABASE ENVIRONMENT AND DEVELOPMENT PROCESS
Chapter 3: Modeling Data in the Organization
Adding Multiple Logical Table Sources
Methodology Conceptual Databases Design
Chapter 4 Entity Relationship (ER) Modeling
Geo-Databases: lecture 5 Data Manipulation in SQL
Database Processing: David M. Kroenke’s Chapter Five:
Software Analysis.
Geo-Databases: lecture 6 Data Integrity
Geo-Databases: lecture 3 Simple Queries in SQL
Geo-Databases: lecture 4 Complex Queries in SQL
Databases and Information Management
Entity Relationship (ER) Modeling
Chapter 6b: Database Design Using the E-R Model
© 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke
Presentation transcript:

Geo-Databases: lecture 7 Database design Prof. Dr. Thomas H. Kolbe Institute for Geodesy and Geoinformation Science Technische Universität Berlin Credits: This material is mostly an english translation of the course module no. 8 (‘Geo-Datenbanksysteme‘) of the open e-content platform www.geoinformation.net.

Database design 21/09/2018

Motivation (1) Desired: A suitable relational schema in order to describe a given application (mini-world) Role of the database design: Systematic development of database schemata, with regard to the specific information needs of the user. Starting with SQL right away has some disadvantages: Poor in structuring concepts Application semantics therefore hidden in tables, foreign keys, etc Effects of changes in the real world on the schema hardly traceable Instead, we may perform the design process on a conceptual level: Usage of an abstract modelling language (e.g. Entity-Relationship-diagrams, UML-models) Projectable onto the language of the DBMS, e.g. an SQL schema 21/09/2018

Database design– a miniature example Task: Examination database Problem: Projection of an object-model into a relational schema? 21/09/2018

Logical design / Implementation A conceptual model can be converted into an implementable database model. 21/09/2018

Translation into the relational model There are some “cooking recipes“, that can help with the translation of a UML-diagram into a relational schema. Generally, the translation process can be carried out in several steps: Each class, that does not take part in the inheritance hierarchy is projected onto a table Each association, besides inheritance, is projected onto a table Refinement: Some tables can be combined Separate treatment of inheritance hierarchies 21/09/2018

Translation of classes Each class is projected onto a table. Name of the table: name of the class Attributes: Attributes of the class in the UML-diagram Note: if necessary, UML-data types have to be adapted to the SQL-data types! Example: 21/09/2018

Translation of associations Each association is projected onto a table. Name of the table: name of the association or, if existent, of the related association class; otherwise meaningful, new name Attributes: (if necessary attributes might have to be re-named!) Key attributes of the involved classes Attributes of the related association class (if existent) Example: 1:n-relationship between class room and class lecture 21/09/2018

Refinement: Combination of tables Some of the tables, that emanate from associations, can be eliminated. Let A and B be the classes / tables of the association. The options for the combination are determined by the type of association. 1:1 The key of B can be added to table A or vice versa. The association table can be eliminated 1:n The key of A can be added to the table B (“n-side“). The association table can be eliminated n:m The association table should persist. key of room for lecture 21/09/2018

Translation of inheritance hierarchies When it comes to inheritance hierarchies only the concerned classes are translated but not the inheritance relationships. There are several reasonable alternatives: One table per class in the hierarchy One table for each partial tree of the hierarchy that emanates from the root A single table for the entire hierarchy Criteria for the selection of an alternative: Required space (tuple size and number of emerged tables) Support of important manipulation operations and queries for the given application 21/09/2018

inheritance hierarchies, alternative I Alternative I: One table per class in the hierarchy. For each table: Name of the table: name of the class Attributes: Attributes of the corresponding class in the UML-diagram Key attributes of the root in the hierarchy, that remain keys 21/09/2018

inheritance hierarchies, alternative II (1) Alternative II: A table for each partial tree of the hierarchy that emanates from the root. For each partial tree: Name of the table: meaningful, clear name Attributes: al attributes of the concerned classes, renamed if necessary Tables: Persons, PersonsEmp, PersonsEmpProf, PersonsEmpAss, PersonsEmpProfAss, PersonsStud, PersonsEmpStud, PersonsEmpAssStud, PersonsEmpProfStud, PersonsEmpProfAssStud PersonsEmpAssStud wage Street 21/09/2018

inheritance hierarchies, alternative II (2) Alternative II illustrates the subject of disjunctive / non-disjunctive inheritance. An inheritance hierarchy is called non-disjunctive, if an object of an upper class K may have the type of more than one lower class of K. In our Example: Person is employee and (phd-) student at the same time Non-disjuntive inheritance can be expressed in all of the presented translation alternatives Alternative II shows an analogy to object-oriented programming languages in terms of disjuntive inheritance: All attributes of an object are stored in a “coherent“ memory area. If an inheritance hierarchy was translated according to alternative II, it requires the following amendments: Eliminate all tables that represent nonsensical combination in terms of the given application! In our Example: PersonsEmpProfStud 21/09/2018

inheritance hierarchies, alternative III Alternative III: A single table for the entire hierarchy. Name of the table: for example class name of the root Attributes: all class attributes that appear in the hierarchy, renamed if necessary. Not corresponding attributes are set to NULL! 21/09/2018

inheritance hierarchies, comparison (1) Comparison of the alternatives on the basis of the previously mentioned size parameters and the example query: “show name and rank of all professors!“ tuple size # of tables Example query A I (one table per class) compact besides foreign keys Medium SELECT Name, Rank FROM Professor, Person WHERE Professor.PerID =Person.PersID A II (one table per partial tree) High SELECT Name, Rank FROM PersonsEmpProf UNION SELECT Name, Rank FROM PersonsEmpProfAss SELECT Name, Rank FROM PersonsEmpProfAssStud SELECT Name, Rank FROM PersonsEmpProfStud A III (a single table) large minimal FROM Person WHERE Person.Rank IS NOT NULL 21/09/2018

inheritance hierarchies, comparison (2) Comparison of the alternatives on the basis of the dominating query types in the given application. Attributes of an upper class Attributes of a derivative class Attributes on different levels of the inheritance hierarchy A I + - A II + - A III Dominating attribute queries of the application + / - : number of tables to be included low / high 21/09/2018

Refinement of the design The implementable database schema can be improved: In terms of redundancy: Enforcement of the so-called normalisation of a relational database schema (later!) In terms of performance: controlled redundancy by targeted denormalisation by specifyfing further physical characteristics of the database, such as index structures for efficient access (see also “B-tree“ in LE 8 and “R-tree“ in LE 11) 21/09/2018

References Overview: Hector Garcia-Molina, Jeffrey D. Ullman, Database Systems: The Complete Book, Prentice Hall, 2002 Bernd Oestereich, Objektorientierte Softwareentwicklung: Analyse und Design mit der Unified Modeling Language, Oldenbourg Verlag, München, 1998 Gottfried Vossen, Datenbankmodelle; Datenbanksprachen und Datenbankmanagement-Systeme, Oldenbourg Verlag, München, 1999 Original works: P.P.-S. Chen, The entity-relationship model: Toward a unified view of data, in: ACM Transactions on Database Systems, Vol. 1, Seite 9-36, 1976 J. Rumbaugh, I. Jacobson, G. Booch, The Unified Modeling Language for Object-Oriented Development - Documentation Set 0.9 Addendum, Rational Software Corporation, Santa Clara 1996 21/09/2018