Sie sind auf Seite 1von 42
Normalization and Codd’s Rules

Normalization and Codd’s Rules

Normalization and Codd’s Rules
n Normalization n Normal Forms   n 1 NF n 2 NF n 3 NF
n Normalization n Normal Forms   n 1 NF n 2 NF n 3 NF

n

Normalization

n

Normal Forms

 

n

1 NF

n

2 NF

n

3 NF

n

Codd’s Rules

Data Normalization n The purpose of normalization is to produce a stable set of relations
Data Normalization
Data Normalization

n The purpose of normalization is to produce a stable set of relations that is a faithful model of the operations of the enterprise.

n

Achieve a design that is highly flexible

n

Reduce redundancy

n

Ensure that the design is free of certain update, insertion and deletion anomalies

Normalization Flat Flat file file Partial Partial dependencies dependencies removed removed Transitive Transitive

Normalization

Normalization Flat Flat file file Partial Partial dependencies dependencies removed removed Transitive Transitive
Normalization Flat Flat file file Partial Partial dependencies dependencies removed removed Transitive Transitive

FlatFlat filefile

Normalization Flat Flat file file Partial Partial dependencies dependencies removed removed Transitive Transitive
Normalization Flat Flat file file Partial Partial dependencies dependencies removed removed Transitive Transitive

PartialPartial dependenciesdependencies removedremoved

Partial Partial dependencies dependencies removed removed Transitive Transitive dependencies dependencies removed
Partial Partial dependencies dependencies removed removed Transitive Transitive dependencies dependencies removed

TransitiveTransitive dependenciesdependencies removedremoved

Transitive dependencies dependencies removed removed Every Every determinant determinant is is a a candidate
Transitive dependencies dependencies removed removed Every Every determinant determinant is is a a candidate

EveryEvery determinantdeterminant isis aa candidatecandidate keykey

determinant is is a a candidate candidate key key Non Non - - tivial tivial multi
determinant is is a a candidate candidate key key Non Non - - tivial tivial multi

NonNon--tivialtivial multimulti--valuedvalued dependenciesdependencies removedremoved

10001 Order No. Stereos To Go Invoice 6 15 99 / / Date: Stereos To
10001 Order No. Stereos To Go Invoice 6 15 99 / / Date: Stereos To

10001

Order No.

Stereos To Go

Invoice

6 15 99

/

/

Date:

Stereos To Go

0000-000-0000-0

John Smith

2036-26 Street

Sacramento

CA 95819

City

6 18 99

/

/

State

Zip Code

Account No.

Customer:

00000000 000000 00000000 00 JohnJohn SmithSmith

Address:

1/051/05

Date Shipped:

Item

Product

Number

Code

Product Description/Manufacturer

Qty

Price

1

SAGX730

Pioneer Remote A/V Receiver

1 56995

2

AT10

Cervwin Vega Loudspeakers

1 35995

3

CDPC725

Sony Disc-Jockey CD Changer

1 39995

4

     

5

     

Subtotal Shipping & Handling Sales Tax Total

132985

10000

10306

153291

Go,Go, HogsHogs
Go,Go, HogsHogs
Unnormalized Relation ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

Unnormalized Relation

Unnormalized Relation ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

((Invoice_numberInvoice_number,, Invoice_date,Invoice_date, Date_delivered,Date_delivered, Cust_accountCust_account Cust_nameCust_name Cust_addrCust_addr Cust_cityCust_city Cust_stateCust_state Zip_code,Zip_code, Item1Item1 Item1_descripItem1_descrip Item1_qtyItem1_qty Item1_price,Item1_price, Item2Item2 Item2_descripItem2_descrip Item2_qtyItem2_qty Item2_price,Item2_price, Item7Item7 Item7_descripItem7_descrip Item7_qtyItem7_qty Item7_price)Item7_price)

,,

HowHow wouldwould aa programprogram processprocess thethe datadata toto recreaterecreate thethe invoice?invoice?

Unnormalized to 1NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

Unnormalized to 1NF

Unnormalized to 1NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

((Invoice_numberInvoice_number,, Invoice_date,Invoice_date, Date_delivered,Date_delivered, Cust_accountCust_account

Cust_nameCust_name

Item1,Item1, Item1_descrip,Item1_descrip, Item1_qty,Item1_qty, Item1_price,Item1_price, Item2,Item2, Item2_descrip,Item2_descrip, Item2_qty,Item2_qty, Item2_price,Item2_price, Item7,Item7, Item7_descrip,Item7_descrip, Item7_qty,Item7_qty, Item7_price)Item7_price)

Cust_addrCust_addr

Cust_cityCust_city

Cust_stateCust_state

Zip_code,Zip_code,

,,

RepeatingRepeating groupsgroups

Zip_code, Zip_code, , , Repeating Repeating groups groups This This is is reminiscent reminiscent of of

ThisThis isis reminiscentreminiscent ofof aa COBOLCOBOL oror BASICBASIC programprogram processingprocessing aa singlesingle transactiontransaction withwith oneone readread statement.statement.

Unnormalized to 1NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

Unnormalized to 1NF

Unnormalized to 1NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

((Invoice_numberInvoice_number,, Invoice_date,Invoice_date, Date_delivered,Date_delivered, Cust_accountCust_account,, Cust_nameCust_name,, Cust_addrCust_addr,, Cust_cityCust_city,, Cust_stateCust_state,, Zip_code,Zip_code,

Item,Item, Item_descripItem_descrip,, Item_qty,Item_qty, Item_price)Item_price)

, , Item_qty, Item_qty, Item_price) Item_price) Nominated Nominated group group of of attributes

NominatedNominated groupgroup ofof attributesattributes toto serveserve asas thethe keykey (form(form aa uniqueunique combination)combination)

EliminateEliminate thethe repeatingrepeating groups.groups. EachEach rowrow retainsretains datadata forfor oneone item.item. IfIf aa personperson boughtbought 55 items,items, wewe wouldwould havehave fivefive tuplestuples

numbernumber namename

InvoiceInvoice AccountAccount numbernumber

CustomerCustomer

Invoice Account Account number number Customer Customer 1NF Flat Flat File File   Item Item Item
1NF
1NF

FlatFlat FileFile

 

ItemItem

ItemItem

ItemItem

DescriptionDescription

QuantityQuantity

PricePrice

10001

10001

10001

123456

123456

123456

John Smith

John Smith

John Smith

•••••• •••

SAGX730SAGX730 SAGX730 PioneerPioneer Pioneer RemoteRemote Remote A/VA/V A/V RecRec Rec

 

11 1 569.95569.95

569.95

10001

10001

10001

123456

123456

123456

John Smith

John Smith

John Smith

•••••• •••

AT10AT10 AT10

CerwinCerwin Cerwin VegaVega Vega LoudspeakersLoudspeakers Loudspeakers 1 1

1

359.95

359.95

359.95

10001

10001

10001

123456

123456

123456

John Smith

John Smith

John Smith

•••••• •••

CDPC725CDPC725 CDPC725 SonySony Sony DiscDisc Disc JockeyJockey Jockey CDCD CD

 

11 1 399.95399.95

399.95

10001

10001

10001

123456

123456

123456

John Smith

John Smith

John Smith

•••••• •••

S/HS/H S/H

ShippingShipping Shipping

 

11 1 100.00100.00

100.00

10001

10001

10001

123456

123456

123456

John Smith

John Smith

John Smith

•••••• •••

TaxTax Tax

SalesSales Sales TaxTax Tax

 

11 1 103.06103.06

103.06

From 1NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered, Cust_account

From 1NF

From 1NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered, Cust_account

((Invoice_numberInvoice_number,, Invoice_date,Invoice_date, Date_delivered,Date_delivered, Cust_accountCust_account,, Cust_nameCust_name,, Cust_addrCust_addr,, Cust_cityCust_city,, Cust_stateCust_state,, Zip_code,Zip_code, ItemItem,, Item_descripItem_descrip,, Item_qty,Item_qty, Item_price)Item_price)

FunctionalFunctional dependenciesdependencies andand determinantsdeterminants

Example:Example: item_descripitem_descrip isis functionallyfunctionally dependentdependent onon item,item, suchsuch thatthat itemitem isis thethe determinantdeterminant ofof item_descript.item_descript.

From 1NF to 2NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

From 1NF to 2NF

From 1NF to 2NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

((Invoice_numberInvoice_number,, Invoice_date,Invoice_date, Date_delivered,Date_delivered, Cust_accountCust_account,, Cust_nameCust_name,, Cust_addrCust_addr,, Cust_cityCust_city,, Cust_stateCust_state,, Zip_code)Zip_code)

((ItemItem,, Item_descripItem_descrip,, Item_qty,Item_qty, Item_price)Item_price)

, , Item_qty, Item_qty, Item_price) Item_price) Is Is this this unique unique by by itself? itself?

IsIs thisthis uniqueunique byby itself?itself? WhatWhat happenshappens ifif thethe itemitem isis purchasedpurchased moremore thanthan once?once?

From 1NF to 2NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

From 1NF to 2NF

From 1NF to 2NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

((Invoice_numberInvoice_number,, Invoice_date,Invoice_date, Date_delivered,Date_delivered, Cust_accountCust_account,, Cust_nameCust_name,, Cust_addrCust_addr,, Cust_cityCust_city,, Cust_stateCust_state,, Zip_code)Zip_code)

PartialPartial dependencydependency

Zip_code) Zip_code) Partial Partial dependency dependency ( ( Invoice_number, Invoice_number, Item Item , ,

((Invoice_number,Invoice_number, ItemItem,, Item_descripItem_descrip,, Item_qty,Item_qty, Item_price)Item_price)

, , Item_qty, Item_qty, Item_price) Item_price) Composite Composite key key (forms (forms a a unique

CompositeComposite keykey (forms(forms aa uniqueunique combination)combination)

From 1NF to 2NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

From 1NF to 2NF

From 1NF to 2NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

((Invoice_numberInvoice_number,, Invoice_date,Invoice_date, Date_delivered,Date_delivered, Cust_accountCust_account,, Cust_nameCust_name,, Cust_addrCust_addr,, Cust_cityCust_city,, Cust_stateCust_state,, Zip_code)Zip_code)

((Invoice_number,Invoice_number, ItemItem,, Item_qty,Item_qty, Item_price)Item_price)

((ItemItem,, Item_descripItem_descrip))

From 2NF to 3NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

From 2NF to 3NF

From 2NF to 3NF ( ( Invoice_number Invoice_number , , Invoice_date, Invoice_date, Date_delivered, Date_delivered,

((Invoice_numberInvoice_number,, Invoice_date,Invoice_date, Date_delivered,Date_delivered, Cust_accountCust_account,, Cust_nameCust_name,, Cust_addrCust_addr,, Cust_cityCust_city,, Cust_stateCust_state,, Zip_code)Zip_code)

((Invoice_number,Invoice_number, ItemItem,, Item_qty,Item_qty, Item_price)Item_price)

((ItemItem,, Item_descripItem_descrip))

WhichWhich attributesattributes areare dependentdependent onon others?others? IsIs therethere aa problem?problem?

Transitive Dependencies and Anomalies n Insertion anomalies n To add a new row, all customer

Transitive Dependencies and Anomalies

Transitive Dependencies and Anomalies n Insertion anomalies n To add a new row, all customer (name,

n

Insertion anomalies

n To add a new row, all customer (name, address, city, state, zip code, phone) and products (description) must be consistent with previous entries

n

Deletion anomalies

n By deleting a row, a customer or product may cease to exist

n

Modification anomalies

n To modify a customer’s or product’s data in one row, all modifications must be carried

Insertion and Modification Anomalies For example… Insert Insert a a new new Panasonic Panasonic product

Insertion and Modification Anomalies For example…

Insertion and Modification Anomalies For example… Insert Insert a a new new Panasonic Panasonic product product

InsertInsert aa newnew PanasonicPanasonic productproduct

Product_codeProduct_code Manufacturer_nameManufacturer_name

DVDDVD--A110A110 DVD-A110 PanasonicPanasonic Panasonic PVPV--42104210 PV-4210 PanasonicPanasonic Panasonic
DVDDVD--A110A110 DVD-A110
PanasonicPanasonic Panasonic
PVPV--42104210 PV-4210
PanasonicPanasonic Panasonic
CTCT--32S3532S35 CT-32S35
PANPAN PAN
PVPV--42504250 PV-4250
PanasonicPanasonic Panasonic
DVDDVD--A110A110 DVD-A110
PanasonicPanasonic Panasonic
PVPV--42104210 PV-4210
PanaSonicPanaSonic PanaSonic
PVPV--42504250 PV-4250
PanaPana Pana SonicSonic Sonic
CTCT--32S3532S35 CT-32S35
PANPAN PAN

InconsistencyInconsistency

ChangeChange allall PanasonicPanasonic productsproductsmanufacturermanufacturer namename toto PanasonicPanasonic USAUSA

Deletion Anomaly For Example… 43771824377182 JohnJohn SmithSmith SacramentoSacramento CACA 9583195831 llllll

Deletion Anomaly

For Example… 43771824377182 JohnJohn SmithSmith SacramentoSacramento CACA 9583195831 llllll 43987114398711
For Example…
43771824377182
JohnJohn SmithSmith
SacramentoSacramento
CACA
9583195831
llllll
43987114398711
ArnoldArnold SS
DavisDavis
CACA
9569195691
llllll
45784614578461
GrayGray DavisDavis
SacramentoSacramento
CACA
9583195831
llllll
48731794873179
LisaLisa CarrCarr
RenoReno
NVNV
8955789557
llllll

ByBy deletingdeleting customercustomer ArnoldArnold S,S, wewe wouldwould alsoalso bebe deletingdeleting Davis,Davis, California.California.

Invoice_number Invoice_number Invoice_date Invoice_date Cust_name Cust_name Cust_addr Cust_addr Cust_city
Invoice_number Invoice_number Invoice_date Invoice_date Cust_name Cust_name Cust_addr Cust_addr Cust_city Cust_city
Invoice_number Invoice_number Invoice_date Invoice_date Cust_name Cust_name Cust_addr Cust_addr Cust_city Cust_city

Invoice_numberInvoice_number

Invoice_number Invoice_number Invoice_date Invoice_date Cust_name Cust_name Cust_addr Cust_addr Cust_city Cust_city

Invoice_dateInvoice_date

Cust_nameCust_name

Cust_addrCust_addr

Cust_cityCust_city

Cust_stateCust_state

Zip_codeZip_code

ItemItem

Cust_city Cust_state Cust_state Zip_code Zip_code Item Item Item_descrip Item_descrip Invoice_number+Item

Item_descripItem_descrip

Invoice_number+ItemInvoice_number+Item

Item_qtyItem_qty

Item_priceItem_price

TransitiveTransitive

DependenciesDependencies Date_deliveredDate_delivered Cust_accountCust_account
DependenciesDependencies
Date_deliveredDate_delivered
Cust_accountCust_account

ŸŸ AA conditioncondition wherewhere A,A, B,B, CC areare attributesattributes ofof aa relationrelation suchsuch thatthat ifif AA àà BB andand

BB àà C, C, then then C C is is transitively transitively

dependentdependent onon AA viavia BB (provided(provided thatthat AA isis notnot

functionally functionally dependent dependent on on B B oror C).C).

Why Should City and State Be Separated from Customer Relation? n City and state are

Why Should City and State Be Separated from Customer Relation?

Should City and State Be Separated from Customer Relation? n City and state are dependent on

n

City and state are dependent on zip code for their values and not the customer’s identifier (i.e., key).

Zip_code à City, State

n

Otherwise,

Cust_account à Cust_addr, Zip_code à City, State

3NF Invoice Invoice Relation Relation (Invoice_number, (Invoice_number, Invoice_date, Invoice_date, Date_delivered,

3NF

3NF Invoice Invoice Relation Relation (Invoice_number, (Invoice_number, Invoice_date, Invoice_date, Date_delivered,

InvoiceInvoice RelationRelation

(Invoice_number,(Invoice_number,Invoice_date,Invoice_date,Date_delivered,Date_delivered, Cust_accountCust_account))

CustomerCustomer RelationRelation

((Cust_accountCust_account,, Cust_nameCust_name,, Cust_addrCust_addr,, Zip_code)Zip_code)

Zip_codeZip_code RelationRelation

(Zip_code,(Zip_code, City,City, State)State)

Invoice_itemsInvoice_items RelationRelation

(Invoice_number,(Invoice_number, Item,Item, Item_qty,Item_qty, Item_price)Item_price)

ItemsItems RelationRelation

(Item,(Item, Item_descripItem_descrip))

3NF Invoice Invoice Relation Relation (Invoice_number, (Invoice_number, Invoice_date, Invoice_date, Date_delivered,

3NF

3NF Invoice Invoice Relation Relation (Invoice_number, (Invoice_number, Invoice_date, Invoice_date, Date_delivered,

InvoiceInvoice RelationRelation

(Invoice_number,(Invoice_number,Invoice_date,Invoice_date,Date_delivered,Date_delivered, Cust_accountCust_account))

CustomerCustomer RelationRelation

((Cust_accountCust_account,, Cust_nameCust_name,, Cust_addrCust_addr,, Zip_code)Zip_code)

Zip_codeZip_code RelationRelation

(Zip_code,(Zip_code, City,City, State)State)

Invoice_itemsInvoice_items RelationRelation

(Invoice_number,(Invoice_number, Item,Item, Item_qty,Item_qty, Item_price)Item_price)

ItemsItems RelationRelation

(Item,(Item, Item_descripItem_descrip))

ManufacturersManufacturers RelationRelation

) ) Manufacturers Manufacturers Relation Relation ( ( Manuf_code Manuf_code , , Manuf_name Manuf_name ) )

((Manuf_codeManuf_code,, Manuf_nameManuf_name))

SinceSince thethe ItemsItems relationrelation containscontains thethe manufacturermanufacturerss namename inin thethe description,description, aa separateseparate ManufacturersManufacturers relationrelation cancan bebe createdcreated

First to Third Normal Form (1NF - 3NF) n 1NF: A relation is in first

First to Third Normal Form

(1NF - 3NF)
(1NF - 3NF)

n

1NF: A relation is in first normal form if and only if every attribute is single-valued for each tuple (remove the repeating or multi-value attributes and create a flat file)

n

2NF: A relation is in second normal form if and only if it is in first normal form and the nonkey attributes are fully functionally dependent on the key (remove partial dependencies)

n

3NF: A relation is in third normal form if it is in second normal form and no nonkey attribute is transitively dependent on the key (remove transitive dependencies)

Codd's Rules E. F. Codd presented these rules as a basis of determining whether a
Codd's Rules
Codd's Rules

E. F. Codd presented these rules as a basis of determining whether a DBMS could be classified as Relational

Codd's Rules n Codd's Rules can be divided into 5 functional areas – n Foundation
Codd's Rules
Codd's Rules

n Codd's Rules can be divided into 5 functional areas –

n

Foundation Rules

n

Structural Rules

n

Integrity Rules

n

Data Manipulation Rules

n

Data Independence Rules

Foundation Rules n Rule 0 – n Any system claimed to be a RDBMS must
Foundation Rules n Rule 0 – n Any system claimed to be a RDBMS must

Foundation Rules

n Rule 0 – n Any system claimed to be a RDBMS must be able to manage databases entirely through its relational capabilities.

n All data definition & manipulation must be able to be done through relational ops.

Foundation Rules n Rule 12 - Nonsubversion Rule - n If a RDBMS has a

Foundation Rules

Foundation Rules n Rule 12 - Nonsubversion Rule - n If a RDBMS has a low

n

Rule 12 - Nonsubversion Rule -

n

If a RDBMS has a low level (record at a time) language, that low level language cannot be used to subvert or bypass the integrity rules &constraints expressed in the higher-level relational language.

n All database access must be controlled through the DBMS so that the integrity of the database cannot be compromised without the knowledge of the user or the DBA.

n This does not prohibit use of record at a time languages e.g. PL/SQL

Codd's Rules n Structural Rules (Rules 1 & 6) n The fundamental structural construct is
Codd's Rules
Codd's Rules

n Structural Rules (Rules 1 & 6)

n

The fundamental structural construct is the table.

n

Codd states that an RDBMS must support tables, domains, primary & foreign keys.

n

Each table should have a primary key.

Structural Rules n Rule 1 - n All info in a RDB is represented explicitly

Structural Rules

Structural Rules n Rule 1 - n All info in a RDB is represented explicitly at

n Rule 1 - n All info in a RDB is represented explicitly at the logical level in exactly one way - by values in a table.

n ALL info even the Metadata held in the system catalogue MUST be stored as relations(tables) & manipulated in the same way as data.

Structural Rules n Rule 6 - View Updating – n All views that are theoretically

Structural Rules

Structural Rules n Rule 6 - View Updating – n All views that are theoretically updatable

n Rule 6 - View Updating – n All views that are theoretically updatable are updatable by the system.

n Not really implemented yet by any available system.

Codd's Rules n Integrity Rules (Rules 3 & 10) n Integrity should be maintained by
Codd's Rules
Codd's Rules

n

Integrity Rules (Rules 3 & 10)

n Integrity should be maintained by the DBMS not the application.

n

Rule 3 - Systematic treatment of null values -

n

Null values are supported for representation of 'missing' & inapplicable information in a systematic way & independent of data type.

Integrity Rules n Rule 10 - Integrity independence - n Integrity constraints specific to a

Integrity Rules

Integrity Rules n Rule 10 - Integrity independence - n Integrity constraints specific to a particular

n

Rule 10 - Integrity independence -

n

Integrity constraints specific to a particular RDB MUST be definable in the relational data sublanguage & storable in the DB, NOT the application program.

n This gives the advantage of centralised control & enforcement

Codd's Rules n Data Manipulation Rules (Rule 2, 4, 5 & 7) n User should
Codd's Rules
Codd's Rules

n

Data Manipulation Rules (Rule 2, 4, 5 & 7)

n

User should be able to manipulate the 'Logical View' of the data with no need for knowledge of how it is Physically stored or accessed.

n

Rule 2 - Guaranteed Access -

n

Each & every datum in an RDB is guaranteed to be logically accessible by a combination of table name, primary key value & column name.

Data Manipulation Rules n Rule 4 - Dynamic on-line Catalog based on relational model n
Data Manipulation Rules
Data Manipulation Rules

n

Rule 4 - Dynamic on-line Catalog based on relational model

n

The DB description (metadata) is represented at logical level in the same way as ordinary data, so that same relational language can be used to interrogate the metadata as regular data.

n System & other data stored & manipulated in the same way.

Data Manipulation Rules n Rule 5 - Comprehensive Data Sublanguage - n RDBMS may support
Data Manipulation Rules
Data Manipulation Rules

n

Rule 5 - Comprehensive Data Sublanguage -

n

RDBMS may support many languages & modes of use, but there must be at least ONE language whose statements can express ALL of the following -

n

Data Definition

n

View Definition

n

Data manipulation (interactive & via program)

n

Integrity constraints

n

Authorization

n

Transaction boundaries (begin, commit & rollback)

n 1992 - ISO standard for SQL provides all these functions

Data Manipulation Rules n Rule 7 - High-level insert, update & delete - n Capability
Data Manipulation Rules
Data Manipulation Rules

n

Rule 7 - High-level insert, update & delete -

n

Capability of handling a base table or view as a single operand applies not only to data retrieval but also to insert, update & delete operations.

Codd's Rules n Data Independence Rules (Rules 8, 9 11) n These rules protect users
Codd's Rules
Codd's Rules

n

Data Independence Rules (Rules 8, 9

11)

n

These rules protect users & application developers from having to change the applications following any low-level reorganisation of the DB.

Data Independence Rules n Rule 8 - Physical Data Independence - n Application Programs &

Data Independence Rules

Data Independence Rules n Rule 8 - Physical Data Independence - n Application Programs & Terminal

n

Rule 8 - Physical Data Independence -

n

Application Programs & Terminal Activities remain logically unimpaired whenever any changes are made either to the storage organisation or access methods.

n

Rule 9 - Logical Data Independence -

n

Appn Progs & Terminal Acts remain logically unimpaired when information-preserving changes of any kind that theoretically permit unimpairment are made to the base tables.

Data Independence Rules n n Rule 11 - Distribution Independence - The data manipulation sublanguage
Data Independence Rules
Data Independence Rules

n

n

Rule 11 - Distribution Independence -

The data manipulation sublanguage of an RDBMS must enable application programs & queries to remain logically unchanged whether & whenever data is physically centralised or distributed.

Data Independence Rules n Rule 11 - Distribution Independence - n This means that an
Data Independence Rules
Data Independence Rules

n Rule 11 - Distribution Independence -

n This means that an Application Program that accesses the DBMS on a single computer should also work ,without modification, even if the data is moved from one computer to another in a network environment.

n The user should 'see' one centralised DB whether data is located on one or more computers.

Data Independence Rules n Rule 11 - Distribution Independence – n This rule does not
Data Independence Rules
Data Independence Rules

n Rule 11 - Distribution Independence –

n This rule does not say that to be fully Relational the DBMS must support distributed DB's but that if it does the query must remain the same.

Summary n Codd's Rules can be divided into 5 functional areas – n Foundation Rules
Summary
Summary

n Codd's Rules can be divided into 5 functional areas –

n

Foundation Rules

n

Structural Rules

n

Integrity Rules

n

Data Manipulation Rules

n

Data Independence Rules