Logical Database Design Chapter 4 G. Green 1. Agenda Evolution of Data Models Chapter 1 pgs 25 – 28 Chapter 9 pgs 409 – 418 Relational Database Model.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

The Hierarchical Model
Introduction to Databases
1 1 File Systems and Databases. 1 1 Introducing the Database 4Major Database Concepts u Data and information l Data - Raw facts l Information - Processed.
1 Basic DB Terms Data: Meaningful facts, text, graphics, images, sound, video segments –A collection of individual responses from a marketing research.
File Systems and Databases
Chapter 17 Designing Databases
The Relational Database Model:
Ch1: File Systems and Databases Hachim Haddouti
File Systems and Databases Hachim Haddouti
Chapter 11 Data Management Layer Design
Chapter 4: Database Management. Databases Before the Use of Computers Data kept in books, ledgers, card files, folders, and file cabinets Long response.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
System Analysis and Design
Data at the Core of the Enterprise. Objectives  Define of database systems  Introduce data modeling and SQL  Discuss emerging requirements of database.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
LECTURE 2 DATABASE SYSTEM CONCEPTS AND ARCHITECTURE.
IST Databases and DBMSs Todd S. Bacastow January 2005.
PHASE 3: SYSTEMS DESIGN Chapter 7 Data Design.
The Relational Database Model
3 The Relational Model MIS 304 Winter Class Objectives That the relational database model takes a logical view of data That the relational model’s.
2 1 Chapter 2 Data Model Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
1 DATABASE TECHNOLOGIES BUS Abdou Illia, Fall 2007 (Week 3, Tuesday 9/4/2007)
Week 1 Lecture MSCD 600 Database Architecture Samuel ConnSamuel Conn, Asst. Professor Suggestions for using the Lecture Slides.
Chapter 4 The Relational Model.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Data at the Core of the Enterprise. Objectives  Define of database systems.  Introduce data modeling and SQL.  Discuss emerging requirements of database.
Systems analysis and design, 6th edition Dennis, wixom, and roth
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
Concepts and Terminology Introduction to Database.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
I Information Systems Technology Ross Malaga 4 "Part I Understanding Information Systems Technology" Copyright © 2005 Prentice Hall, Inc. 4-1 DATABASE.
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
Chapter 12: Designing Databases
What's a Database A Database Primer Let’s discuss databases n Why they are hard n Why we need them.
Chapter 13 Designing Databases Systems Analysis and Design Kendall & Kendall Sixth Edition.
Management Information Systems, 4 th Edition 1 Chapter 8 Data and Knowledge Management.
Lection №4 Development of the Relational Databases.
IS 320 Notes for April 15, Learning Objectives Understand database concepts. Use normalization to efficiently store data in a database. Use.
1 DATABASE TECHNOLOGIES (Part 2) BUS Abdou Illia, Fall 2015 (September 9, 2015)
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Logical Database Design and the Relational Model.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Lecture 4: Logical Database Design and the Relational Model 1.
Logical Database Design and Relation Data Model Muhammad Nasir
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
DBS201: Data Modeling. Agenda Data Modeling Types of Models Entity Relationship Model.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Databases and DBMSs Todd S. Bacastow January
CompSci 280 S Introduction to Software Development
Intro to MIS – MGS351 Databases and Data Warehouses
Logical Database Design and the Rational Model
Architecture & Data Models
Database Management System
Introduction to Database Management System
Basic Concepts in Data Management
MANAGING DATA RESOURCES
File Systems and Databases
Databases.
The Relational Database Model
Chapter 17 Designing Databases
Chapter 3 Database Management
Presentation transcript:

Logical Database Design Chapter 4 G. Green 1

Agenda Evolution of Data Models Chapter 1 pgs 25 – 28 Chapter 9 pgs 409 – 418 Relational Database Model Transforming ERDs into Relations Referential Integrity Normalization G. Green 2

The Evolution of Data Models Hierarchical Network Relational Object oriented Multi-dimensional NoSQL G. Green 3

Relational Data Model Developed by Codd (IBM) in 1970 Represents data in the form of tables Based on mathematical theory 3 Components: relational database structure relational rules (integrity) relational operations (manipulation) G. Green 4

Relational Data Model Advantages Structural independence Improved conceptual simplicity Easier database design, implementation, management, and use Ad hoc query capability Mathematical foundation Disadvantages Hardware and system software overhead Can facilitate poor design and implementation May promote “islands of information” problems G. Green 5

Relational Theory Components 1.Relational Database Structures 2.Rules of Relations 3.Relational Operators G. Green 6

1. Relational Database Structure  Relations, Tuples, Attributes › Tables, Rows, Columns › Files, Records, Fields  Primary Key must be designated  Foreign Keys must be designated for relationships G. Green 7 CLASS TABLE ROOM TABLE

2. Rules of Relations  Relation names must be unique  Entries in columns are atomic (single valued)  Entries in column are from same domain  Each row is unique  Ordering is insignificant G. Green 8 CLASS Table

2. Rules of Relations, con’t...  Data in tables should be added, updated, and deleted without errors › avoid inconsistency ==> referential integrity  insertion  update  Deletion › avoid anomalies ==> normalization  insertion  update  deletion G. Green 9

3. Relational Operators Relational Algebra UNION (+) INTERSECTION DIFFERENCE (-) PRODUCT (x) SELECT (tuples) PROJECT (attributes) JOIN (PRODUCT, SELECT, PROJECT) G. Green 10 * Diagram adapted from Hyperion presentation, sakovskii-slides/sld001.htm * *

Converting ERD to Relational Model Represent entities as relations Represent relationships as either: foreign keys in relations new relations Provide sample data Normalize relations G. Green 11

Representing Entities as Tables Each entity converted to a relational table attributes become columns primary key must be designated regular entities have atomic keys associative entities have composite keys subtype entities have same key as supertype example entity instances are rows of table G. Green 12

ERD Example Problem Revisited A company sells products to customers Customer requests generate orders Orders may consist of many ordered products Products may be contained on many orders, or no orders at all G. Green 13

14 ERD Example Converted to Tables

Representing Relationships  1:1 › merge attributes into single table; › OR create foreign key (FK) in either relation  1:M › create foreign key (FK) in relation on “many” side of relationship  M:M › should’ve been eliminated on ERD!!! › create new relation with PKs of related entities as (1) concatenated PK, and (2) FKs in new relation G. Green 15

Referential Integrity Maintains consistency between data in related tables For every value of a foreign key there must be an existing primary key with that value Create rules/constraints for: insertion of foreign keys update and deletion of primary keys G. Green 16

Adding Referential Integrity Constraints D:R, U:C (PK) (FK) D:R, U:C (PK) (FK)

Adding Referential Integrity Constraints, cont… G. Green 18

Normalization Convert complex relations into simpler relations Why? Ensures relations conform to rules Ensures relation contains facts about one “theme” Reveals/corrects redundancies, errors, ambiguities in data model Only a simple check IF good data model exists Normal Forms state of a relation rids relations of potential anomalies G. Green 19

Normalization, con’t... Insertion Anomalies are experienced when we attempt to store a value for one field but cannot because the value of another field is unknown e.g., cannot add a new customer’s information until an order number is ready to be entered G. Green 20 Order IDOrder DateCustomer ID Customer Name Customer Address (PK)

Normalization, con’t... Deletion Anomalies are experienced when a value for one field we wish to keep is unexpectedly removed when a value for another field is deleted e.g., cannot delete the sole order for a customer without deleting the only copy of the customer’s information also G. Green 21 Order IDOrder DateCustomer ID Customer Name Customer Address (PK)

Normalization, con’t... Update Anomalies are experienced when changes to multiple records of a table are needed to effect an update to a single value of a field e.g., cannot completely update a customer’s address without changing it for every order placed by that customer G. Green 22 Order IDOrder DateCustomer ID Customer Name Customer Address (PK)

G. Green 23 Steps in Normalization

Normalization, con’t... Every attribute is dependent on: the key (1NF) the WHOLE key (2NF) and nothing but the key (3NF) G. Green 24

1NF The table is a relation Primary key No repeating values or groups only atomic values All column values from same domain To correct: define new (usually associative) entity G. Green 25

2NF 1NF + No partial functional dependencies (Full) Functional dependency when the value of one attribute can be determined based on the value of another attribute Partial functional dependency when a non-key attribute is functionally dependent on a part of the PK Already in 2NF if: PK is NOT concatenated Relation contains no non-key attributes To correct: Decompose into 2 or more relations (if not already) one with original (concatenated) key + attributes one (or more) with the “depended on” partial key as PK + attributes G. Green 26

3NF 2NF + No transitive dependencies Transitive dependency a functional dependency between 2 non-key attributes when a non-key attribute is functionally dependent on another non-key attribute Already in 3NF if: only 0 or 1 non-key attributes in relation To correct: Decompose into 2 or more relations (if not already) one with original PK + attributes one (or more) with “depended on” non-key attribute as PK + attributes G. Green 27

OTHER DATA MODELS G. Green 28

The Evolution of Data Models Hierarchical Network Relational Object oriented Multi-dimensional NoSQL G. Green 29

Hierarchical Data Model Each parent can have many children Each child has only one parent Tree defined by path that traces parent segments to child segments, beginning from the left Hierarchical path Ordered sequencing of segments tracing hierarchical structure G. Green 30

Problem: Child with Multiple Parents G. Green 31

Hierarchical Data Model, cont… Advantages Database security Performance, efficiency Data independence Disadvantages Complex implementation Structural dependence Complex applications programming and use Lack of standards G. Green 32

Network Data Model  Created to: › Represent complex M:M data relationships Child can have many parents › Impose a database standard  Resembles hierarchical model › Collection of records in 1:M relationships  Sets › Implement relationships › Composed of:  Owner  Member G. Green 33

Network Data Model, cont… Advantages Handles more relationship types Conformance to standards Disadvantages System complexity Lack of (popular) product support G. Green 34

Big Data Big Data = more than you're able to effectively process Influenced by Mobile, Social Networking, Web analytics, RFID, Atmospheric, Medical Research data, … Issue: ability of traditional RDBMSs to handle “big data” G. Green 35

Big Data RDBMS Issues Traditional RDBMS Problems Transaction-focus  Requires schema  maintenance issue ACID-focus  Requires locks, db constraints, joins  performance & availability issues "Relatively" small amounts of operational data  Exceptions require complex, $ actions  scalability issue Traditional RDBMS Solutions G. Green 36 Reference:

Complex Data Landscape NOTE: This diagram is for effect ONLY—it is incomplete (e.g., no MDDB, no OODB) AND contains some inaccuracies G. Green 37

Big Data Solutions  NewSQL Databases  Columnar Databases  Hadoop  NoSQL Databases G. Green 38

Big Data Solutions  NewSQL Databases Relational-based Good when high scalability needed with relational DBMSs  Re-written, highly optimized storage engines  "Sharding" (i.e. horizontal partitioning across multiple DB instances)  In-memory databases  Distributed query processing G. Green 39

Big Data Solutions  Columnar Databases Good for data warehouses, analytics  computing aggregates on a few columns File contains:  all values of a specific column vs. all values of all columns G. Green 40

Multidimensional Data Model  Data represented as cube  Modeling and analyzing of data across dimensions  Cube depicts business measures analyzed by dimensions  Optimized for decision-making vs. transaction processing  Data storage  Pre-aggregation  De-normalization  Basis for data warehouses G. Green 41

Big Data Solutions  Hadoop Good for storing, retrieving large amounts of semi- and unstructured data in batch/offline mode  HDFS: data distributor  MapReduce: request/processing distributor G. Green 42

NoSQL Databases Focus (in most cases): Scalability via Physical Distribution and Replication of data No fixed schema "Individual query systems" instead of SQL Support for semi- and un-structured data Some provide consistency Apache's Hbase Amazon's DynamoDB Most provide "eventual consistency" Google’s BigTable Facebook's Cassandra Amazon's SimpleDB Uses a variety of data models… G. Green 43

Big Data/NoSQL, cont… NoSQL Physical Data Models Column (Family) Store Key Value Store Document Store Graph G. Green 44 Advantages Highly scalable Good for many writes Support for semi- and un-structured data Data Model (schema) does not have to be defined up-front Many are open source Cloud options available (e.g., Amazon's SimpleDB) Disadvantages No common query language Data inconsistency (“dirty reads”) Reliance on client applications for data validation, consistency, etc…

Summary Data Models Hierarchical Network Multidimensional NoSQL/Big Data ACID, BASE Relational Model Components Structure Rules Manipulation Transforming ERDs to Relations Representing entities and relationships  understand foreign keys Referential Integrity  understand RI constraints Normalization Purpose  understand anomalies 3 normal forms G. Green 45