Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
6

6

Ratings: (0)|Views: 29|Likes:
Published by api-3834497

More info:

Published by: api-3834497 on Oct 18, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PPT, PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

\u00a9Silberschatz, Korth and Sudarshan
6.1
Database System Concepts
Chapter 6: Integrity and Security
Chapter 6: Integrity and Security

sDomain Constraints
sReferential Integrity
sAssertions
sTriggers
sSecurity
sAuthorization
sAuthorization in SQL

\u00a9Silberschatz, Korth and Sudarshan
6.2
Database System Concepts
Domain Constraints
Domain Constraints
sIntegrity constraints guard against accidental damage to the
database, by ensuring that authorized changes to the database do
not result in a loss of data consistency.
sDomain constraints are the most elementary form of integrity
constraint.
sThey test values inserted in the database, and test queries to
ensure that the comparisons make sense.
sNew domains can be created from existing data types
5E.g.create domainDollars numeric(12, 2)
create domainPounds numeric(12,2)
sWe cannot assign or compare a value of type Dollars to a value of
type Pounds.
5However, we can convert type as below
(castr.Aas Pounds)
(Should also multiply by the dollar\u00adto\u00adpound conversion\u00adrate)
\u00a9Silberschatz, Korth and Sudarshan
6.3
Database System Concepts
Domain Constraints (Cont.)
Domain Constraints (Cont.)
sThecheck clause in SQL\u00ad92 permits domains to be restricted:
5Usecheck clause to ensure that an hourly\u00adwage domain allows only
values greater than a specified value.
create domainhourly\u00adwage numeric(5,2)
constraintvalue\u00adt est check(value > = 4.00)
5The domain has a constraint that ensures that the hourly\u00adwage is
greater than 4.00
5The clauseco nstrain tvalue\u00ad tes t is optional; useful to indicate which
constraint an update violated.
sCan have complex conditions in domain check
5create domainAccount Type char(10)
constraintaccount\u00ad type\u00adt est
check(value in (\u2018Checking\u2019, \u2018Saving\u2019))
5check(branch\u00adname in(selectbr anch\u00ad name frombranch))

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->