CSIS 115 Database Design and Applications for Business

Slides:



Advertisements
Similar presentations
Data Modeling and the Entity-Relationship Model
Advertisements

(wrapping up from last week)
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/1 Copyright © 2004 Please……. No Food Or Drink in the class.
SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 9.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke Database Processing Chapter 6 Transforming Data.
Prentice Hall © COS 346 Day Agenda Questions? Assignment 7 Corrected –4 A’s and 4 B’s Assignment 8 posted –Due April 6 Quiz 2 next class.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 10.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 8.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 7.
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.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming ER Models into Database.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming ER Models into Database.
Transforming Data Models into Database Designs
Working with Queries in Microsoft Access The Access Workbench: Section Three DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
Chapter Six Professor Adams’ Slides. Note that entities are shadowed, tables are not. Note that entities have no physical existence (blueprint) Note.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Six: Transforming Data Models into Database Designs.
Oracle Data Definition Language (DDL) Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Data Modeling IST210 Class Lecture.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
Database Application Design and Data Integrity AIMS 3710 R. Nakatsu.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Gegevens Analyse Les 5: van ERD naar DSD.
1 SY306: Web and Databases for Cyber Operations Slide Set: 11 Databases - Relational Model.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
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.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Six: Transforming Data Models into Database Designs.
Standards and Conventions
Chapter Six: Transforming Data Models into Database Designs 6-1.
CSIS 115 Database Design and Applications for Business
Logical Database Design and the Rational Model
CSIS 115 Database Design and Applications for Business
Chapter 5 Database Design
Databases Chapter 9 Asfia Rahman.
CSIS 115 Database Design and Applications for Business
Chapter 4: Logical Database Design and the Relational Model
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
Transforming Data Models
CSIS 115 Database Design and Applications for Business
The Relational Model and Database Normalization
David M. Kroenke and David J
The Relational Model Chapter Two DATABASE CONCEPTS, 3rd Edition
Requirements Become the E-R Data Model
CSIS 115 Database Design and Applications for Business
MIS 322 – Enterprise Business Process Analysis
Unit 16 – Database Systems
CSIS 115 Database Design and Applications for Business
Translation of ER-diagram into Relational Schema
COS 346 Day 8.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
Data Modelling Introduction
ERD’s REVIEW DBS201.
Chapter 3 The Relational Model.
Database Processing: David M. Kroenke’s Chapter Six:
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Oracle Data Definition Language (DDL)
Chapter 3: Modeling Data in the Organization
Copyright © 2018, 2015, 20 Pearson Education, Inc. All Rights Reserved Database Concepts Eighth Edition Chapter # 2 The Relational Model.
Designs for Data Integrity, validations, security and controls
Database Design: Relational Model
Database Processing: David M. Kroenke’s Chapter Six:
Database Processing: David M. Kroenke’s Chapter Six:
Chapter 3 The Relational Model
Presentation transcript:

CSIS 115 Database Design and Applications for Business Dr. Meg Fryling “Dr. Meg” Fall 2012 @SienaDrMeg #csis115

Agenda Quiz Homework (see next slide) Project Part II Appointments Chapter 6: Translating ER Diagrams to Relations Conceptual design to physical database

Homework See Course Schedule for Readings! Project – Part II (Rewrite) Due Weds, 10/31 by start of class Midterm is Mon, 11/5 Will discuss format as we get closer May bring a “cheat sheet” 8.5x11, handwritten, both sides, must use your own!

Project ER Diagram Make an appointment with to go over your project ER Diagram Go to Doodle Poll to select appt day/time http://www.doodle.com/z549que58ybwc3cd Pick a timeslot by start of class Monday (10/22) If you cannot make any of these times you must let me know by the end of this week so we can find an alternate time.

Chapter 6 Transforming data models (ER Diagrams) into database designs What is involved?

Chapter 6 Objectives To understand how to transform data (ER) models into database designs Represent strong and weak (ID-dependent) entities as tables Add attributes and identify primary keys Determine required: (NOT NULL) Determine default values Determine data constraints Determine datatype: char, integer, etc. KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Chapter 6 Objectives Use of referential integrity constraints and actions Establish relationships between entities 1:1, 1:N, and N:M Foreign keys Enforcing minimum cardinalities Foreign keys and constraints KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Phase 1 - Overview Phase 1: Tables, keys, attributes Create a table for each Entity The identifier is a good start for the PK BUT there might be better options Determine if a surrogate key is needed All other attributes become columns in the table for now leave data type as text length 255 for all KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Phase 1: Create a Table for Each Entity EMPLOYEE (EmployeeNumber, EmployeeName, Phone, Email, HireDate, ReviewDate, EmpCode) Primary key is designated by the key symbol KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Phase 1: Select the Primary Key The ideal primary key is short, numeric, and fixed. Surrogate keys meet the ideal, but typically have no meaning to users. Created by database (e.g. autonumber) unique for table KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Now, you do it! Blackboard Assignments > In-Class Activities > 5 – ER (Conceptual) to DB (Physical) Phase 1 only Note: For now, leave all data types the default (i.e. text, 255 length)

Phase 2 - Overview Phase 2: data type, NULL, other constraints Pick most appropriate way to represent each attribute. Determine which attributes are NOT NULL. Sometimes we relax that condition when loading data into a database Identify default value, if any Identify any other data constraints KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Phase 2: Specify Column Properties, Null Status Null status indicates if the value of the column can be NULL In Microsoft Access we control this by setting Required to yes or no (see next slide) KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

NULL status KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Highline University Example Which fields do we want to make required (not null)?

Phase 2: Specify data types ACCESS type: NUMBER Storage implications for Number: Byte: 8 bits: 0..255 Integer: 2 bytes: 64K Long Integer: 4 bytes : 4 billion Single: 4 bytes Double: 8 bytes Default Value For numbers with decimal points (e.g. GPA) KROENKE and AUER - DATABASE CONCEPTS (3rd Edition) © 2008 Pearson Prentice Hall

Phase 2: ACCESS data type: Text Storage implications for text: Fixed in size, up to 255 bytes (characters). Default Value is 255. Note: data types do vary a bit depending on the database (e.g. SQL Server, MySQL, Oracle) KROENKE and AUER - DATABASE CONCEPTS (3rd Edition) © 2008 Pearson Prentice Hall

Phase 2: ACCESS basic data types: Others KROENKE and AUER - DATABASE CONCEPTS (3rd Edition) © 2008 Pearson Prentice Hall

Highline University Example Open Highland University Database This entity has already been converted to a table Update Table Set appropriate data types See previous slide! Any fields you would require (not null)? Do so!

Phase 2: Specify Column Properties: Default Value A default value is the value supplied by the DBMS when a new row is created. KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Highline University Example Let’s say 95% our students come from NY. What default value might you add? Do it!

Column Properties: Data Constraints Data constraints are limitations on data values Domain constraint Validation Rule (Validation Text) column values must be in a given set of specific values: “Red”, “Green”, ”Blue” Range constraint column values must be within a given range of values: between 1 and 1000 KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Domain or range constraint See Highland University database for examples KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Highline University Example Let’s say we only include a high school GPA if it was between 3.5 and 4.0 How would we enforce that? Do it!

Column Properties: Data Constraints Data constraints are limitations on data values Data format constraints Input Mask Text or Date field types only Zip in 12211-0101 format Phone in (518) 555-5151 format KROENKE AND AUER - DATABASE PROCESSING, 11th Edition © 2010 Pearson Prentice Hall

Highline University Example What data format constraints make sense here? Date data types Input masks

Intrarelation Constraint

Highline University Example Add an intrarelation constraint that ensures graduation date is after admission date. Hint: See previous slide

Now, you do it! Blackboard Assignments > In-Class Activities > 5 – ER (Conceptual) to DB (Physical) Phase 2 only