+ Relational Model IST210 Class Lecture. + Premiere Products A new company that is going to sells random merchandise via sales representatives You have.

Slides:



Advertisements
Similar presentations
(wrapping up from last week)
Advertisements

Lab Exercise This Week PHP Basics See last Friday’s slides for requirements Make sure you show the final results to TA to get credit 1IST210.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 7 th Edition.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
The Relational Model Chapter Two. 2 Chapter Objectives Learn the conceptual foundation of the relational model Learn the conceptual foundation of the.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke’s Chapter Three: The Relational Model and Normalization.
Fundamentals, Design, and Implementation, 9/e Chapter 4 The Relational Model and Normalization.
The Relational Model CIS 218. Entity A Person, Place, Thing or Transaction Something the user wants to track.
Chapter 17 Designing Databases
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke Database Processing Chapter 3 Normalization.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Chapter 5 Normalization Transparencies © Pearson Education Limited 1995, 2005.
The Relational Model Chapter Two (Excerpts) DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
NORMALIZATION N. HARIKA (CSC).
Microsoft Access 1 Database Creation and Management.
+ Structured Query Language Part 2 KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
Chapter 3 The Relational Model and Normalization
Chapter 5 Database Processing.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Chapter 4: Logical Database Design and the Relational Model (Part II)
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Concepts and Terminology Introduction to Database.
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
Database Basics CPSC 4670/ Purpose of a Database The purpose of a database is to keep track of things Unlike a list or spreadsheet, a database.
Chapter 4 The Relational Model and Normalization.
The Relational Model and Normalization R. Nakatsu.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, Modified by Dr. Mathis 3-1 David M. Kroenke’s Chapter Three: The Relational.
The Relational Model Chapter Two DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
Chapter 2. The Relational Model IST2101. Chapter 1 Review Potential problems with Lists – Deletion – Update – Insertion Avoid these problems using a relational.
Chapter 4 Database Processing Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall 4-1.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Slide 1 Chapter 03 The Relational Model and Normalization.
The Relational Model J.G. Zheng Jan 2010 CIS 8040 Database Management Systems.
Chapter 10 Normalization Pearson Education © 2009.
Chapter 13 Designing Databases Systems Analysis and Design Kendall & Kendall Sixth Edition.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/1 Copyright © 2004 Please……. No Food Or Drink in the class.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
IS 320 Notes for April 15, Learning Objectives Understand database concepts. Use normalization to efficiently store data in a database. Use.
THE RELATIONAL MODEL I IST 210: Organization of Data IST210 1.
© 2002 by Prentice Hall 1 The Relational Model David M. Kroenke Database Concepts 1e Chapter 2 2.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
+ Structured Query Language Part 2 KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming Data Models into Database.
Microsoft Access 2010 Chapter 11 Database Design.
Normalization ACSC 425 Database Management Systems.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Three: The Relational Model and Normalization.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Designing Databases Systems Analysis and Design, 8e Kendall & Kendall 13.
Chapter 4 © 2013 Pearson Education, Inc. Publishing as Prentice Hall Chapter 4: Logical Database Design and the Relational Model Modern Database Management.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
Microsoft Access 1 Database Creation and Management.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Three: The Relational Model and Normalization.
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
The Relational Model and Database Normalization
The Relational Model Chapter Two DATABASE CONCEPTS, 3rd Edition
MIS 322 – Enterprise Business Process Analysis
Chapter 4 Relational Databases
Chapter 9 Designing Databases
Database Processing: David M. Kroenke’s Chapter Three:
David M. Kroenke and David J
Copyright © 2018, 2015, 20 Pearson Education, Inc. All Rights Reserved Database Concepts Eighth Edition Chapter # 2 The Relational Model.
Chapter 17 Designing Databases
Chapter 4 The Relational Model and Normalization
Presentation transcript:

+ Relational Model IST210 Class Lecture

+ Premiere Products A new company that is going to sells random merchandise via sales representatives You have been hired by HR to develop their employee data requirements What information would you want to keep about each employee?

+ Premiere Products Now you have been hired by the sales department. They want to know what information they will need to keep track of on sales orders. What information do you think need?

+ Premiere Products Sales Order

+ Entity An entity is something of importance to a user that needs to be represented in a database. An entity is a person, place, object, event, or idea for which you want to store and process data An entity represents one theme or topic. In an entity-relationship model (discussed in Chapter 4), entities are restricted to things that can be represented by a single table. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Relation A relation is a two-dimensional table that has specific characteristics. The table dimensions, like a matrix, consist of rows and columns. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Characteristics of a Relation 1. Rows contain data about an entity. 2. Columns contain data about attributes of the entity. 3. Cells of the table hold a single value. 4. All entries in a column are of the same kind. 5. Each column has a unique name. 6. The order of the columns is unimportant. 7. The order of the rows is unimportant. 8. No two rows may be identical. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ A Sample Relation EmployeeNumberFirstNameLastName 100MaryAbernathy 101JerryCadley 104AlexCopley 107MeganJackson KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ A Nonrelation Example EmployeeNumberPhoneLastName , Abernathy Cadley Copley Jackson Cells of the table hold multiple values KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ A Nonrelation Example EmployeeNumberPhoneLastName Abernathy Cadley Copley Abernathy Jackson No two rows may be identical KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Terminology Synonyms … TableRowColumn FileRecordField RelationTupleAttribute KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ A Relational Database A relational database is a collection of tables Tables are called relations This term is the basis for the name relational database KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ A Key A key is one (or more) column(s) of a relation that is (are) used to identify a row. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Uniqueness of Keys Unique KeyNonunique Key Data value is unique for each row. Consequently, the key will uniquely identify a row. Data value may be shared among several rows. Consequently, the key will identify a set of rows. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ A Composite Key A composite key is a key that contains two or more attributes. For a key to be unique, it must often become a composite key. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Composite Key Characteristics To identify a family member, you need to know a FamilyID, a FirstName, and a Suffix (e.g., Jr.). The composite key is: (FamilyID, FirstName, Suffix). One needs to know the value of all three columns to uniquely identify an individual. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ A Candidate Key A candidate key is called “candidate” because it is a candidate to become the primary key. A candidate key is a unique key. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ A Primary Key A primary key is a candidate key chosen to be the main key for the relation. If you know the value of the primary key, you will be able to uniquely identify a single row. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ A Surrogate Key A surrogate key is a unique, numeric value that is added to a relation to serve as the primary key. Surrogate key values have no meaning to users and are usually hidden on forms, queries, and reports. A surrogate key is often used in place of a composite primary key. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Surrogate Key Example If the Family Member primary key is FamilyID, FirstName, Suffix, it would be easier to append and use a surrogate key of FamMemberID. FamilyID, FirstName and Suffix remain in the relation. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Relationships Between Tables A table may be related to other tables. For example An Employee works in a Department A Manager controls a Project KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ A Foreign Key To preserve relationships, you may need to create a foreign key. A foreign key is a primary key from one table placed into another table. The key is called a foreign key in the table that received the key. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Foreign Key Example I Employee EMPID FirstName MgrID Manager MgrID MgrName Foreign Key Primary Key KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Foreign Key Example II Department DeptID DeptName Location Employee EmpID DeptID EmpName Foreign Key Primary Key KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ The Null Value A Null value means that no data was entered. This is different from a zero, space character, or tab character. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ The Problem of the Null Value A Null is often ambiguous. It could mean… The column value is not appropriate for the specific row. The column value is not decided. The column value is unknown. Each may have entirely different implications. KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Functional Dependency Functional Dependency—A relationship between attributes in which one attribute (or group of attributes) determines the value of another attribute in the same table Illustration… The price of one cookie can determine the price of a box of 12 cookies. (CookiePrice, Qty)BoxPrice KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Determinants The attribute (or attributes) that we use as the starting point (the variable on the left side of the equation) is called a determinant. (CookiePrice, Qty)BoxPrice Determinant KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Normalization KROENKE and AUER - DATABASE CONCEPTS (6th Edition) Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

+ Normalization Normalization is the transformation of complex user views and data to a set of smaller, stable, and easily maintainable data structures. Normalization creates data that are stored only once on a file. The exception is key fields. The data structures are simpler and more stable. The data is more easily maintained.

+ Three Steps of Data Normalization The three steps of data normalization are: Remove all repeating groups and identify the primary key. Ensure that all nonkey attributes are fully dependent on the primary key. Remove any transitive dependencies, attributes that are dependent on other nonkey attributes.

+ Three Steps of Normalization

+ First Normal Form (1NF) Remove any repeating groups. All repeating groups are moved into a new table. Foreign keys are used to link the tables. When a relation contains no repeating groups, it is in the first normal form.

+ Second Normal Form (2NF) Remove any partial dependencies. A partial dependency is when the data are only dependent on a part of a key field. A relation is created for the data that are only dependent on part of the key and another for data that are dependent on both parts.

+ Third Normal Form (3NF) Remove any transitive dependencies. A transitive dependency is when a relation contains data that are not part of the entity. The problem with transitive dependencies is updating the data. A single data item may be present on many records.