RDBMS CHAPTER 2 RELATIONAL MODEL E F Codd
RDBMS CHAPTER - 2
RELATIONAL MODEL
E. F. Codd Rules l Information Rule All information in the database should be represented in one and only one way - as values in a table. l Guaranteed Access Rule Each and every datum (atomic value) is guaranteed to be logically accessible by resorting to a combination of table name, primary key value and column name.
E. F. Codd Rules l Systematic Treatment of Null Values Null values (distinct from empty character string or a string of blank characters and distinct from zero or any other number) are supported in the fully relational DBMS for representing missing information in a systematic way, independent of data type.
E. F. Codd Rules l l Dynamic On-line Catalog Based on the Relational Model The database description is represented at the logical level in the same way as ordinary data, so authorized users can apply the same relational language to its interrogation as they apply to regular data.
E. F. Codd Rules Comprehensive Data Sublanguage Rule A relational system may support several languages and various modes of terminal use. However, there must be at least one language whose statements are expressible, per some well-defined syntax, as character strings and whose ability to support all of the following is comprehensible: l l l l data definition view definition data manipulation (interactive and by program) integrity constraints authorization transaction boundaries (begin, commit, and rollback).
E. F. Codd Rules l l View Updating Rule All views that are theoretically updateable are also updateable by the system. High-level Insert, Update, and Delete The capability of handling a base relation or a derived relation as a single operand applies nor only to the retrieval of data but also to the insertion, update, and deletion of data.
E. F. Codd Rules l l Physical Data Independence Application programs and terminal activities remain logically unimpaired whenever any changes are made in either storage representation or access methods. Logical Data Independence Application programs and terminal activities remain logically unimpaired when information preserving changes of any kind that theoretically permit unimpairment are made to the base tables.
E. F. Codd Rules l l Integrity Independence Integrity constraints specific to a particular relational database must be definable in the relational data sublanguage and storable in the catalog, not in the application programs. Distribution Independence The data manipulation sublanguage of a relational DBMS must enable application programs and terminal activities to remain logically unimpaired whether and whenever data are physically centralized or distributed.
E. F. Codd Rules l l Nonsubversion Rule If a relational system has or supports a lowlevel (single-record-at-a-time) language, that low-level language cannot be used to subvert or bypass the integrity rules or constraints expressed in the higher-level (multiplerecords-at-a-time) relational language.
Keys l Super Key l Candidate Key l Primary Key l Foreign Key
Types Of Integrity Constraints l Domain l Entity Integrity Constraint l Referential Integrity Constraint
Foreign Key l On Delete Cascade l On Update Cascade l Eg: l l references rollno on delete cascade on update cascade
Database Security 1. Data Tempering
Eaves Dropping
Falsifying user Identities l Pretend to be some one else
Password threats
Threats l Unauthorized access to table and columns Columns
Unauthorized Access to rows Rows
Threats l Lack of Accountability
Data Security Requirements l Confidentiality l Privacy of communication l Secure storage of sensitive data l Authenticated users l Granular access control l Integrity l Availability
Data Authorization Matrix Subject A Ram Object Action Constraint student Insert None Emp Update, Delete Salary Not Null
Relational Algebra Roll No 1 2 3 4 Name Minu Meera Sayali Pravin Sport_id 11 12 Address Pune Mumbai Pune Gujrat Roll no 1 3
Relational Algebra Select Operation ( σ ) l TO select a particular row l l σ (roll no = 1 (student)) 1 Minu Pune
Project Operation (π) l π (rollno, name (Student)) Roll No 1 2 3 4 Name Minu Meera Sayali Pravin
Union operator (U) l l π (rollno (Student)) U π (rollno (Sports))
Minus operator (-) l π (rollno (Student)) l π (rollno (Sports))
Cartesian Operator (X) l Student X sports Student. rolln o Student. n ame Student. a ddress Sports. Roll No Sport. sport_id 1 Minu Pune 1 11 2 Meera Mumbai 1 11 3 Sayali Pune 1 11 4 Pravin Gujrat 1 11 1 Minu Pune 3 12 2 Meera Mumbai 3 12
Rename Operation(ρ) l π (s. rollno, s. name, s. address, s 1, rollno, s 1. sport_id Student X ρ s 1 sports)) (ρ s
Other Relational Operators ln l (Intersection operator) π (rollno (Student)) n l π (rollno (Sports))
Natural Join ⋈ l π (s. rollno, s. name, s. address, s 1, rollno, s 1. sport_id Student ⋈ ρ s 1 sports)) (ρ s
Assignment Operator l Temp 1 π r -s( R)
Extended Relational operators Generalized Projection l π(marks 1+marks 2 (Student)) l Output------ Marks 1+marks 2 -----------21 23 Marks 1 Marks 2 10 11 12 11
Aggregation Function(G) l G sum(marks)(Student) l. G sum(marks), avg(marks), min(marks), max(marks)(Student)
Outer Join l Full Outer Join l Left Outer Join l Right Outer Join
- Slides: 35