1. Trang chủ
  2. » Công Nghệ Thông Tin

Constraints triggers motivation

10 497 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 1,57 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Jennifer Widom Constraints Triggers Motivation and overview Jennifer Widom Constraints Triggers Constraints and Triggers  For relational databases  SQL standard; systems vary considerably (Integrity) Constraints constrain allowable database states Triggers monitor database changes, check conditions and initiate actions Jennifer Widom Constraints Triggers Integrity Constraints Impose restrictions on allowable data, beyond those imposed by structure and types Examples Jennifer Widom Constraints Triggers Integrity Constraints Impose restrictions on allowable data, beyond those imposed by structure and types Why use them? Jennifer Widom Constraints Triggers Integrity Constraints Impose restrictions on allowable data, beyond those imposed by structure and types Classification Jennifer Widom Constraints Triggers Declaring and enforcing constraints Declaration  With original schema  Or later Enforcement  Check after every modification  Deferred constraint checking Jennifer Widom Constraints Triggers Triggers “EventConditionAction Rules” When event occurs, check condition; if true, do action Examples Jennifer Widom Constraints Triggers Triggers “EventConditionAction Rules” When event occurs, check condition; if true, do action Why use them? Jennifer Widom Constraints Triggers Triggers in SQL “EventConditionAction Rules” Create Trigger name Before|After|Instead Of events referencingvariables For Each Row When ( condition ) action Jennifer Widom Constraints Triggers Constraints and Triggers  For relational databases  SQL standard; systems vary considerably (Integrity) Constraints constrain allowable database states Triggers monitor database changes, check conditions and initiate actions

Trang 1

Constraints & Triggers

Motivation and

overview

Trang 2

Jennifer Widom

Constraints & Triggers

Constraints and Triggers

 For relational databases

 SQL standard; systems vary considerably

(Integrity) Constraints

constrain allowable database states

Triggers

monitor database changes,

check conditions and initiate actions

Trang 3

Integrity Constraints

Impose restrictions on allowable data, beyond those

imposed by structure and types

Examples

Trang 4

Jennifer Widom

Constraints & Triggers

Integrity Constraints

Impose restrictions on allowable data, beyond those

imposed by structure and types

Why use them?

Trang 5

Integrity Constraints

Impose restrictions on allowable data, beyond those

imposed by structure and types

Classification

Trang 6

Jennifer Widom

Constraints & Triggers

Declaring and enforcing constraints

Declaration

 With original schema

 Or later

Enforcement

 Check after every modification

 Deferred constraint checking

Trang 7

Triggers

“Event-Condition-Action Rules”

When event occurs, check condition; if true, do action

Examples

Trang 8

Jennifer Widom

Constraints & Triggers

Triggers

“Event-Condition-Action Rules”

When event occurs, check condition; if true, do action

Why use them?

Trang 9

Triggers in SQL

“Event-Condition-Action Rules”

Create Trigger name

Before|After|Instead Of events

[ referencing-variables ]

action

Trang 10

Jennifer Widom

Constraints & Triggers

Constraints and Triggers

 For relational databases

 SQL standard; systems vary considerably

(Integrity) Constraints

constrain allowable database states

Triggers

monitor database changes,

check conditions and initiate actions

Ngày đăng: 24/05/2016, 15:18

TỪ KHÓA LIÊN QUAN

w