Large-Object Types Large objects(photos,videos,CAD files,etc.)are stored as a large object: blob:binary large object--object is a large collection of uninterpreted binary data(whose interpretation is left to an application outside of the database system) clob:character large object--object is a large collection of character data When a query returns a large object,a pointer is returned rather than the large object itself. Database System Concepts,5th Edition,Oct 5.2006 4.7 Silberschatz,Korth and Sudarshan
Database System Concepts, 5th Edition, Oct 5. 2006 4.7 ©Silberschatz, Korth and Sudarshan Large-Object Types Large objects (photos, videos, CAD files, etc.) are stored as a large object: blob: binary large object -- object is a large collection of uninterpreted binary data (whose interpretation is left to an application outside of the database system) clob: character large object -- object is a large collection of character data When a query returns a large object, a pointer is returned rather than the large object itself
Integrity Constraints Integrity 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. A checking account must have a balance greater than $10,000.00 A salary of a bank employee must be at least $4.00 an hour A customer must have a(non-null)phone number Database System Concepts,5th Edition,Oct 5.2006 4.8 Silberschatz,Korth and Sudarshan
Database System Concepts, 5th Edition, Oct 5. 2006 4.8 ©Silberschatz, Korth and Sudarshan Integrity Constraints Integrity 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. A checking account must have a balance greater than $10,000.00 A salary of a bank employee must be at least $4.00 an hour A customer must have a (non-null) phone number
Constraints on a Single Relation not null primary key unique check(P),where Pis a predicate Database System Concepts,5th Edition,Oct 5.2006 4.9 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5th Edition, Oct 5. 2006 4.9 ©Silberschatz, Korth and Sudarshan Constraints on a Single Relation not null primary key unique check (P ), where P is a predicate
Not Null Constraint Declare branch name for branch is not null branch_name char(15)not null Declare the domain Dollars to be not null create domain Dollars numeric(12,2)not null Database System Concepts,5th Edition,Oct 5.2006 4.10 Silberschatz,Korth and Sudarshan
Database System Concepts, 5th Edition, Oct 5. 2006 4.10 ©Silberschatz, Korth and Sudarshan Not Null Constraint Declare branch_name for branch is not null branch_name char(15) not null Declare the domain Dollars to be not null create domain Dollars numeric(12,2) not null
The Unique Constraint unique(A1,A2,....Am) The unique specification states that the attributes A1,A2,...Am form a candidate key. Candidate keys are permitted to be null (in contrast to primary keys). Database System Concepts,5th Edition,Oct 5.2006 4.11 Silberschatz,Korth and Sudarshan
Database System Concepts, 5th Edition, Oct 5. 2006 4.11 ©Silberschatz, Korth and Sudarshan The Unique Constraint unique ( A1 , A2 , …, Am) The unique specification states that the attributes A1, A2, … Am form a candidate key. Candidate keys are permitted to be null (in contrast to primary keys)