General Constraints and Event Condition Action Model

Slides:



Advertisements
Similar presentations
DB glossary (focus on typical SQL RDBMS, not XQuery or SPARQL)
Advertisements

Active database concepts
POSTGRESQL DUNGEON WITH TABLE INHERITANCE AND CONSTRAINTS Edel Sherratt.
1 Constraints, Triggers and Active Databases Chapter 9.
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
Methodology Logical Database Design for the Relational Model
LOGICAL DATABASE DESIGN
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Chapter 6: Integrity Objective Key Constraints (Chapter 2) Cardinality Constraints (Chapter 2) Domain Constraints Referential Integrity Assertions Triggers.
Chapter 6: Integrity and Security Thomas Nikl 19 October, 2004 CS157B.
©Silberschatz, Korth and Sudarshan6.1Database System Concepts Chapter 6: Integrity and Security Domain Constraints Referential Integrity Assertions Triggers.
Chapters 17 & 18 Physical Database Design Methodology.
Brian Alderman | MCT, CEO / Founder of MicroTechPoint Pete Harris | Microsoft Senior Content Publisher.
1 SQL: Constraints and Triggers Chapter 5,
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
1 Chapter 17 Methodology - Local Logical Database Design.
IST 210 Constraints and Triggers. IST Constraints and Triggers Constraint: relationship among data elements DBMS should enforce the constraints.
Fall 2001Database Systems1 Triggers Assertions –Assertions describe rules that should hold for a given database. –An assertion is checked anytime a table.
7 1 Constraints & Triggers Chapter Constraints and triggers? Constraints: Certain properties that the DBMS is required to enforce –E.g. primary.
Advanced SQL Concepts - Checking of Constraints CIS 4301 Lecture Notes Lecture /6/2006.
1 CS 430 Database Theory Winter 2005 Lecture 4: Relational Model.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur.
10 1 Chapter 10 - A Transaction Management Database Systems: Design, Implementation, and Management, Rob and Coronel.
Lecture 03 Constraints. Example Schema CONSTRAINTS.
©Silberschatz, Korth and Sudarshan6.1Database System Concepts Chapter 6: Integrity Constraints Domain Constraints Referential Integrity Assertions Triggers.
7.5 Using Stored-Procedure and Triggers NAME MATRIC NUM GROUP Muhammad Azwan Bin Khairul Anwar CS2305A Muhammad Faiz Bin Badrol Shah CS2305B.
1 Constraints and Triggers in SQL. 2 Constraints are conditions that must hold on all valid relation instances SQL2 provides a variety of techniques for.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database Constraints تنبيه.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
April 20022/CS/3X1 Database Design Design method John Wordsworth Department of Computer Science The University of Reading Room.
Chapter 5 Database Design
Methodology Logical Database Design for the Relational Model
Chapter 6: Integrity (and Security)
Business System Development
Chapter 4 Logical Database Design and the Relational Model
Foreign Keys Local and Global Constraints Triggers
Chapter 5: Logical Database Design and the Relational Model
Transaction Management and Concurrency Control
SQL Stored Triggers Presented by: Dr. Samir Tartir
Methodology – Physical Database Design for Relational Databases
Constraints AND Examples
Rules in active databases and integrity constraints
Translation of ER-diagram into Relational Schema
CPSC-310 Database Systems
Module 5: Implementing Data Integrity by Using Constraints
COS 346 Day 8.
CPSC-310 Database Systems
Introduction lecture1.
SQL 101.
Relational Database.
Trigger Overview Element of the database schema
Team Project, Part II NOMO Auto, Part II IST 210 Section 4
Advanced SQL: Views & Triggers
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Triggers and Active Databases
COMP 208/214/215/216 – Lecture 7 Documenting Design.
Domains 4/17/2019 See scm-intranet.
INSTRUCTOR: MRS T.G. ZHOU
SQL – Constraints & Triggers
Integrity 5/5/2019 See scm-intranet.
Relational Data Model - 2
Constraints AND Examples
Triggers 7/11/2019 See scm-intranet.
Database.
Chapter 3 The Relational Model
Presentation transcript:

General Constraints and Event Condition Action Model 1/12/2019 See scm-intranet

Objectives To develop an understanding of integrity constraints. To introduce the Event-Condition-Action Model 1/12/2019 See scm-intranet

Fundamental Constraints The  following are basic integrity constraints which must be considered for a relational schema. Domains (Not) Null Participation conditions Primary keys Referential Integrity (these constraints are not discrete and are closely related to each other) 1/12/2019 See scm-intranet

General Constraints In addition there are typically a large number of other constraints. They are often called business rules, or general constraints.   1/12/2019 See scm-intranet

e.g. in the Flights example The departure time at a stopover must be later than the arrival time at the stopover.  Each stopover arrival time must be later than the departure time at the previous stopover in the flight.  The departure time of a flight must be later than the arrival time of a flight.  Each stopover airport must be different from any other airport in the flight   In the Doctors example- Dates_of_issue and consultation_dates for any patient must be greater than the date_of_birth. Any doctor must not issue more than 36 prescriptions in one day without authorization.  There must be a minimum of five minutes between each prescription issue.   At least one consultation must be with the patient’s registered doctor. 1/12/2019 See scm-intranet

Event-Condition-Action (ECA) Model Event-database operation, external signal, recursive composition of other events. Condition-query issued on database Also Rules- When an event occurs evaluate all the rules that refer to this event. For each relevant rule evaluate the condition. If the condition is satisfied execute action. Action-user defined program 1/12/2019 See scm-intranet

Example: A transaction attempts to insert details of a flight that returns to a previous stopover airport-EVENT Each stopover airport must be different from any other airport in the flight –RULE/CONSTRAINT/CONDITION Reject insert operation, rollback transaction, raise error/exception details- ACTION 1/12/2019 See scm-intranet

Problems The model cannot predict 'transitive closure' of events as the logic of action is hidden in application programs. All consequences of an update cannot be predicted because the update itself may cause event(s) which trigger further actions…..which generate events that trigger actions etc…. There could be contradictory rules where there are large numbers and/or cpomplex rules. And the mutual effects of rules may not be predicted. However, this is the common model for implementation of constraints. 1/12/2019 See scm-intranet

Summary There are a large number of integrity constraints of different types in any domain of discourse A large proportion of these are ‘general constraints’ not expressed by the data model The implementation mechanism for ‘general constraints’ normally uses the ECA model 1/12/2019 See scm-intranet