This is the web Diary and I will blog whenever I feel good to blog. I don't know how blogs were classified .. this is just a Personal Diary or my own views upon things happening around me. Most of the Posts in this blog are written in Myanmar (Burma) Native Language, known as Burmese/Myanmarsar (Not Myanmese or Barmen). This blog is composed with Winkalaw Font. I recommend you to get the Winkalaw 3 (modified) from the link below.



Download WinKalaw Font Unofficial Version 3 for Better Reading

Question by mgtout
I wanna know what is Entity Intigrity and Referencial Intigrity, please.

Possible Answer

tvG,fqHk; ajym&&if Entity Integrity qdkwm NRC Number eJU wlw,f/ 

  1. NRC Data awGtwGuf xm;r,fh NRC Table rSm NRC Number awGu Unique jzpf&r,f/ Table wpfckwnf;rSm Same NRC Number eJU Row 2 ck r&Sd&bl;/
  2. NRC Number qdkwmudk Primary Key tjzpf toHk;jyK&r,f/
  3. NRC Number qdkwm Null vJrjzpf&bl;/

SQL rSm Not Null Unique qdkjyD; ajymMuw,f/ rsm;aomtm;jzifh tJ'D Column udk Primary Key tjzpfoHk;Muw,f/ Entity Integrity qdkwm Single Table xJrSm Duplicate Row awGr&Sdatmif Enforce vkyfay;wJh pepfudkqdkvdkwmjzpfw,f/

tcsKdUaom Table awGrSm Entity Integrity Enforce vkyfzdkUtwGuf Single Column eJU rvkHavmuf&if Multiple Column udk oHk;jyD; Combine Key taeeJU oHk;Muw,f/

Primary Key r&Sd&if bmjzpfrvJ vdkU tcsKdUtcsKdUawG ar;zl;Muw,f/ Table wpfckwnf;oHk;r,fhvltwGuf qdk&ifawmif Duplicate Row awG &SdvmzdkU Possibility awG&Sdvm&if Validation vkyfzdkU Code awG ydka&;&awmhr,f/ RDBMS udk ckdif;vdkuf&if Code a&;&oufomoGm;r,f/ Row awG rsm;vm&if Index vkyfay;vdkU&r,f/ Multiple Table awGeJU csdwfquftoHk;jyKr,fqdk&if ydkjyD;awmh vG,fuljrefqefvmr,f/ Single Table Database r[kwfbl;qdk&if Primary Key r&Sdwmu Exploit awG Duplication awGudk tvdktavsmuf umuG,fjyD;om;jzpfoGm;r,f/

 

Referencial Integrity qdkwmuawmh Foreign Key eJUygwfoufwJh Integrity yg/ 

( Parent & Child Tables ) rdbeJU om;orD;udk csdwfqufay;xm;wJh Link udk Enforce vkyfay;wmygyJ/ Oyrm Voucher Header & Voucher Detail Table 2 ckudk pOf;pm;Munfhr,fqdk&if

Voucher Number wpfckrSm Item awG wpfckxufru&SdvmEdkifw,f/ ( 1 Row in Parent Table related to >=1 Rows from Child Table ) It's representing One to Many Relationship in Data Model.

Link vkyfr,fh Field u Parent Table &JU Primary Key jzpf&r,f/ Child Table rSm olUudk,fydkif Primary Key &Sd&r,f/

Oyrm/   / Voucher No 1. rSm Item 10 ckyg&if tJ'D Item 10 ckpvHk;u Voucher No 1. eJUyJ oufqdkifw,fvdkU od&atmif Voucher Detail Table rSm Voucher Number udk Foreign Key taeeJU oHk;&w,f/ 'grS Voucher Detail Table xJu Row awG[m b,f Voucher eJU ygwfoufovJqdkwm od&r,f/

Referencial Integrity u tJ'D Link udk Enforce vkyfw,f/ tMurf;zsif;ajym&if Parent Table u Voucher No 1 qdkwJh Row udkzsufvdkuf&if Child Table u Voucher 1 eJUygwfoufwJh Row 10 cku t"dyg,frJhoGm;vdrfhr,f/

SQL rSm Referencial Integrity udk Enforce vkyfwJhenf; 3enf;&Sdw,f/

On Delete Restrict ~ txufyg udpö&yfvdkrsKd;rSm 'Denf;udk oHk;w,f/ Child Table rSm oufqdkif&m Row awG&Sdae&if Parent Table u Row udk zsufcGifhray;bl;/

On Delete Cascade ~ Parent Table u Row wpfckudk zsufvdkuf&if oufqdkif&m Child Table u Reference vkyfxm;orQ Row awG tm;vHk;udk Auto zsufay;w,f/ ( tcsKdUaom RDBMS awGu 'Dpepfudk Support rvkyfbl;vdkU zwfzl;w,f/ tJovdkjzpfae&if Parent Table u Row udk zsufwJhae&mrSm Before Delete ae&mrSm Trigger a&;jyD;awmh Child Rows in Child Table awGudk t&if zsuf&w,f/ )

On Delete Set Null ~ 'Denf;u tcsKdUaom Case awGtwGuf Developer udk vkyfydkifcGifh ay;xm;&HkoufoufygyJ/ Referencial Integrity udk tjynfht0 r&EdkifwJhtajctaeeJU Developer &JU udk,fydkif Design/System eJU Referencial Integrity udk xdef;csKyfr,fhtcsdefrsKd;awGrSm toHk;0ifw,f/

Published by Kalvin on Saturday, December 16, 2006 at 11:46 AM.

0 Responses to “Entity Integrity and Referencial Integrity”

Post a Comment

Links to this post

Create a Link


Presented by Kalvin