Entity Life Cycle College of Alameda Copyright © 2008 Patrick McDermott Caspar David Friedrich (1774-1840) The Stages of Life, c.

Slides:



Advertisements
Similar presentations
Designing tables from a data model (Chapter 6) One base table for each entity.
Advertisements

MySQL. To start go to Login details: login: labuser password:macimd15 – There.
Database Administration, Integrity and Performance.
The Database Approach u Emphasizes the integration of data across the organization.
Mid-term Exam Answer Keys Week 7 Spring I. Multiple Choices Questions Each may have more than one answer (6 x 4 = 24 points total)
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 10 Database Application Design.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke Database Processing Chapter 6 Transforming Data.
RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE 
SQL Keys and Constraints Justin Maksim. Key Declaration Key constraint defined within the CREATE TABLE command Key can be declared using either the PRIMARY.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
SQL DDL constraints Restrictions on the columns and tables 1SQL DDL Constraints.
With Microsoft Access 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 4-1 David M. Kroenke Database Processing Chapter 7 Structured Query Language.
10/3/2000SIMS 257: Database Management -- Ray Larson Relational Algebra and Calculus University of California, Berkeley School of Information Management.
Database Constraints. Database constraints are restrictions on the contents of the database or on database operations Database constraints provide a way.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Logical Database Design Nazife Dimililer. II - Logical Database Design Two stages –Building and validating local logical model –Building and validating.
Oracle Data Definition Language (DDL)
Chapters 17 & 18 Physical Database Design Methodology.
INTEGRITY. Integrity constraint Integrity constraints are specified on a database schema and are expected to hold on every valid database state of the.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Data Integrity An empty database is a correct database.
1 Copyright © 2006, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables.
CSCI 3140 Module 3 – Logical Database Design for the Relational Model Theodore Chiasson Dalhousie University.
1 IRU Concurrency, Reliability and Integrity issues Geoff Leese October 2007 updated August 2008, October 2009.
10 Copyright © Oracle Corporation, All rights reserved. Including Constraints.
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
Access Project 3 Notes. Introduction Maintaining the Database  Modifying the data to keep it up-to-date Restructure the Database  To change the database.
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
Recap of SQL Lab no 8 Advance Database Management System.
Select the Services Purchase Order Menu Select Add Recycling Services Purchase Order to create a new Services Purchase Order.
Using the Table API. Standard Uses of API Populate Columns via Sequences Insert Default Values instead of nulls Populate Autogen Columns –Date Created,
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 Goodness College of Alameda Copyright © 2008 Patrick McDermott Berthe Morisot (1841–95) The Cradle, 1872.
Maintaining a Database Access Project 3. 2 What is Database Maintenance ?  Maintaining a database means modifying the data to keep it up-to-date. This.
1 Chapter 17 Methodology - Local Logical Database Design.
Constraints cis 407 Types of Constraints & Naming Key Constraints Unique Constraints Check Constraints Default Constraints Misc Rules and Defaults Triggers.
Oracle 11g: SQL Chapter 4 Constraints.
Database Lab Lecture 1. Database Languages Data definition language ( DDL ) Data definition language –defines data types and the relationships among them.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
INCLUDING CONSTRAINTS lecture5. Outlines  What are Constraints ?  Constraint Guidelines  Defining Constraint  NOT NULL constraint  Unique constraint.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 9 Structured Query Language.
ITEC 3220A Using and Designing Database Systems Instructor: Prof. Z. Yang Course Website: 3220a.htm
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
Including Constraints. What Are Constraints? Constraints enforce rules at the table level. You can use constraints to do the following: – Enforce rules.
Chapter 3: Relational Databases
IMS 4212: Constraints & Triggers 1 Dr. Lawrence West, Management Dept., University of Central Florida Stored Procedures in SQL Server.
Chavez, Melesan Karen De Luna, Lin Detera, Patrick Kevin Martinez, Jellene Joy Dental Clinic Database System Functional Requirements.
CDT/1 Creating data tables and Referential Integrity Objective –To learn about the data constraints supported by SQL2 –To be able to relate tables together.
Copyright © Curt Hill SQL The Data Manipulation Language.
Invoices Training Presentation for Supply Chain Platform: BAE Systems May 2015.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database Constraints تنبيه.
Database Constraints ICT 011. Database Constraints Database constraints are restrictions on the contents of the database or on database operations Database.
Database Constraints Ashima Wadhwa. Database Constraints Database constraints are restrictions on the contents of the database or on database operations.
Getting started with Accurately Storing Data
SQL: Schema Definition and Constraints Chapter 6 week 6
and Defining Table Relationships
Database Systems Instructor Name: Lecture-12.
Module 5: Implementing Data Integrity by Using Constraints
CS122 Using Relational Databases and SQL
Database Design: Relational Model
CS122 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
CS122 Using Relational Databases and SQL
CS122 Using Relational Databases and SQL
Presentation transcript:

Entity Life Cycle College of Alameda Copyright © 2008 Patrick McDermott Caspar David Friedrich ( ) The Stages of Life, c. 1835

Cycle Status: OR Reincarnation: Order is Received  Allocated  Filled  Shipped  Paid  Closed. Requisition  PO  Payable Order  Shipment  Receivable Lead  Prospect  Applicant  Employee  Retiree

SQL Create: INSERT Read: SELECT Update: UPDATE Delete: DELETE

Insertion Constraints 1. Dependent—Permit insertion of child entity occurrence only when matching parent entity occurrence already exists. 2. Automatic—Always permit insertion of child entity occurrence. If parent entity occurrence does not already exist, create it. 3. Nullify—Always permit insertion of child entity occurrence. If matching parent entity occurrence does not exist, set foreign key in child to null. 4. Default—Always permit insertion of child entity occurrence. If matching parent entity occurrence does not exist, set foreign key in child to a previously defined default value. 5. Customized—Permit insertion of child entity occurrence only if certain cus­tomized validity constraints are met. 6. No Effect—Always permit insertion of child entity occurrence. No match­ing parent entity occurrence need exist, and thus no validity checking need be done.

Insertion Examples 1. The user must issue the order to an existing supplier (dependent insert rule). 2. The user may issue the order to an existing or new supplier. If the supplier is new, the user adds that supplier to the approved list of suppliers (automatic insert rule). 3. The user must either issue the order to an existing supplier or record the order without any supplier specification (nullify insert rule). 4. The user must either issue the order to an existing supplier or place it with McD, Inc., the default supplier (default insert rule). 5. The user must issue orders to a supplier who has no more than four orders currently outstanding (customized insert rule). There are, of course, many possible customized insert rules. 6. The user may issue orders even to suppliers not on the approved list. No validity checking is necessary (no effect insert rule). Someone should monitor these supplier numbers.

Parent Deletion Constraints 1. Restrict—Permit deletion of parent entity occurrence only when there are no matching child entity occurrences. 2. Cascade—Always permit deletion of parent entity occurrence and cascade the deletion to any matching child entity occurrences (i.e., delete all matching child entity occurrences). 3. Nullify—Always permit deletion of parent entity occurrence. If any matching child entity occurrences exist, set their foreign keys to null. 4. Default—Always permit deletion of parent entity occurrence. If any matching child entity occurrences exist, set their foreign keys to a previously fined default value. 5. Customized—Permit deletion of parent entity occurrence only if certain customized validity constraints are met. 6. No Effect—Always permit deletion of parent entity occurrence. Matching child entity occurrences mayor may not exist, and thus no validity checking need be done.

Parent Examples 1. The user may not terminate suppliers if the supplier has outstanding orders (restrict delete rule). 2. The user cancels any outstanding orders when terminating a supplier (cascade delete rule). 3. The user retains outstanding orders on file after terminating a supplier, but updates the orders to reflect their unassigned status (nullify delete rule). 4. The user reassigns outstanding orders to Jones, Inc., the default supplier, after terminating the original supplier (default delete rule). 5. The user does not immediately terminate suppliers with outstanding orders, but instead flags them for review at a subsequent date (customized delete rule). Again, there are many possible customized delete rules. 6. The user terminates suppliers regardless of whether the supplier has outstanding orders. No validity checking is necessary (no effect delete rule). Someone should monitor these supplier numbers.

New Key Domain too Small Phones B/L’s Must Change Primary Key for all records Must Change All Foreign Keys Must change all screens Must change all reports