SlideShare a Scribd company logo
1 of 10
Download to read offline
we have in
• A Key is an attribute or a set of attributes in a relation that identifies a tuple
(record) in a relation.
• The keys are defined in a table to access or sequence
and smoothly.
the stored data quickly $
• They are also used to create relationship between differenttables.
ary
• Which is Unique Can’t be have FULL Value
• Is the column you choose to maintain uniqueness in a table at
row level.
• Here in Emplcyee table we can choose either fi wpfoyr rID or SSU column for a PK.
• E mployeeID is preferable choice because SSN is a secure (PII) value.
• Primary key is the minimal super keys. In the ER diagram primary key is
represented by underlining the primary keyattribute.
,EmployeelD
EmployeeName
SSN
• Ideally a primary key is composed of only a single attribute. DeptlD
• But it is possible to have a primary key composed of more than one attribute
DOB
To deLine a Lield as primary hey,
following conditions had to be met :
• No two rows can have the same primary hey value.
• Every row must have a primary hey value.
• The primary hey field cannot be null.
• Value in a primary hey column can never be modified or updated, if any
foreign hey refers to that primary hey
• Are individual columns in a table that qualifies for
uniqueness of each row/ tuple.
• Here in fi»iplo¿ree table Sm ploye e ID & SSN are
for a Prim ary Key and thus are Candidate keys.
eligible
EmgloyeelD
EmployeeName
• Candidate Keys are super lxeys for which no proper subset SSN
is a super hey. In othe r words candidff te k PJS ff J DeptlD
minim al super keys.
DOB
rnate
„„,j,| • Candidate column other the Primary column, lilxe if | ir, - ; '- - -.
Em ploye elD is set for a PK then SSN would be the J mpl Oyee 1D
Alternate hey.
EmployeeName
SSN
DeptlD
DOB
r
g„„,j,| • If you add any other Column /Attribute to a Primary Key |•’ ----- "
then it become a Super Key, lilxe Sm ployee ID '
EmgloyeelD
+Em ployeeNam e is a Super Key.
• Super key stands for superset of a hey.
EmployeeName
• A Super Key is a set of one or m ore attribute s that are SSN
taAe n colle ctive ly and can identify allother attr DeptlD
uniquely.
DOB
• If a table do have a single column that qualifies for a Candidate
key, then you have to select 2 or more columns to make a row
unique.
• Like if there is no E mployeeID or SSN columns, then you can
EmployeelD
EmployeeName
make Em ploye e Nam e + Date O fBirth (DOB) as Composite S
' N
Prim ary Key. But stillAae an & a mrrov dlano: A AQi>te revs. Deptio
DOB
ign
g „„,j| • Here in below tables De ptID of De partment table is Primary Key where as
De ptID of fi»tplo,;yee is an Foreign Aey.
• It means it has referred to another table. This concept is also know as
AeJerential Integrity.
EmployeelD
Employee Name
SSN
DeptlD
DOB
DetID
DeptName
„„,j,| • Unique Aey is same as primary with the diZerence
being the existence of null.
• Unique hey field allows one value as NULL value.
EmployeelD
EmployeeName
SSN
EmaillD
DOB

More Related Content

Similar to key1.pdf

5. relational structure
5. relational structure5. relational structure
5. relational structure
khoahuy82
 
Understanding Entity Relationship Models
Understanding Entity Relationship ModelsUnderstanding Entity Relationship Models
Understanding Entity Relationship Models
HamzaNadeem527928
 

Similar to key1.pdf (20)

computer-210809080138.pdf
computer-210809080138.pdfcomputer-210809080138.pdf
computer-210809080138.pdf
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
DBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptxDBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptx
 
Key in DatabaseManagementSystem_engineering.pptx
Key in DatabaseManagementSystem_engineering.pptxKey in DatabaseManagementSystem_engineering.pptx
Key in DatabaseManagementSystem_engineering.pptx
 
SQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptxSQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptx
 
Key and its different types
Key and its different typesKey and its different types
Key and its different types
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Doc 20191022-wa0041
Doc 20191022-wa0041Doc 20191022-wa0041
Doc 20191022-wa0041
 
Keys in DBMS.pptx
Keys in DBMS.pptxKeys in DBMS.pptx
Keys in DBMS.pptx
 
Ankit
AnkitAnkit
Ankit
 
Relational_Model.ppt
Relational_Model.pptRelational_Model.ppt
Relational_Model.ppt
 
Types of keys in dbms
Types of keys in dbmsTypes of keys in dbms
Types of keys in dbms
 
Database management system
Database management systemDatabase management system
Database management system
 
Advance database system (part 3)
Advance database system (part 3)Advance database system (part 3)
Advance database system (part 3)
 
5. relational structure
5. relational structure5. relational structure
5. relational structure
 
Understanding Entity Relationship Models
Understanding Entity Relationship ModelsUnderstanding Entity Relationship Models
Understanding Entity Relationship Models
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
Relational database management system
Relational database management systemRelational database management system
Relational database management system
 
Databases - Unit 2.pdf
Databases - Unit 2.pdfDatabases - Unit 2.pdf
Databases - Unit 2.pdf
 

More from ajajkhan16

More from ajajkhan16 (15)

Unit-II DBMS presentation for students.pdf
Unit-II DBMS presentation for students.pdfUnit-II DBMS presentation for students.pdf
Unit-II DBMS presentation for students.pdf
 
data stream processing.and its applications pdf
data stream processing.and its applications pdfdata stream processing.and its applications pdf
data stream processing.and its applications pdf
 
data streammining and its applications.ppt
data streammining and its applications.pptdata streammining and its applications.ppt
data streammining and its applications.ppt
 
NOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdfNOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdf
 
Big-Data 5V of big data engineering.pptx
Big-Data 5V of big data engineering.pptxBig-Data 5V of big data engineering.pptx
Big-Data 5V of big data engineering.pptx
 
binarysearchtreeindatastructures-200604055006 (1).pdf
binarysearchtreeindatastructures-200604055006 (1).pdfbinarysearchtreeindatastructures-200604055006 (1).pdf
binarysearchtreeindatastructures-200604055006 (1).pdf
 
Array and its types and it's implemented programming Final.pdf
Array and its types and it's implemented programming Final.pdfArray and its types and it's implemented programming Final.pdf
Array and its types and it's implemented programming Final.pdf
 
sparkbigdataanlyticspoweerpointpptt.pptx
sparkbigdataanlyticspoweerpointpptt.pptxsparkbigdataanlyticspoweerpointpptt.pptx
sparkbigdataanlyticspoweerpointpptt.pptx
 
20-security.ppt
20-security.ppt20-security.ppt
20-security.ppt
 
Linked list.pptx
Linked list.pptxLinked list.pptx
Linked list.pptx
 
08 MK-PPT Advanced Topic 2.ppt
08 MK-PPT Advanced Topic 2.ppt08 MK-PPT Advanced Topic 2.ppt
08 MK-PPT Advanced Topic 2.ppt
 
Unit-I Recursion.pptx
Unit-I Recursion.pptxUnit-I Recursion.pptx
Unit-I Recursion.pptx
 
Unit-I Pointer Data structure.pptx
Unit-I Pointer Data structure.pptxUnit-I Pointer Data structure.pptx
Unit-I Pointer Data structure.pptx
 
Day2.pptx
Day2.pptxDay2.pptx
Day2.pptx
 
Unit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptxUnit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptx
 

Recently uploaded

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 

key1.pdf

  • 1. we have in • A Key is an attribute or a set of attributes in a relation that identifies a tuple (record) in a relation. • The keys are defined in a table to access or sequence and smoothly. the stored data quickly $ • They are also used to create relationship between differenttables.
  • 2.
  • 3. ary • Which is Unique Can’t be have FULL Value • Is the column you choose to maintain uniqueness in a table at row level. • Here in Emplcyee table we can choose either fi wpfoyr rID or SSU column for a PK. • E mployeeID is preferable choice because SSN is a secure (PII) value. • Primary key is the minimal super keys. In the ER diagram primary key is represented by underlining the primary keyattribute. ,EmployeelD EmployeeName SSN • Ideally a primary key is composed of only a single attribute. DeptlD • But it is possible to have a primary key composed of more than one attribute DOB
  • 4. To deLine a Lield as primary hey, following conditions had to be met : • No two rows can have the same primary hey value. • Every row must have a primary hey value. • The primary hey field cannot be null. • Value in a primary hey column can never be modified or updated, if any foreign hey refers to that primary hey
  • 5. • Are individual columns in a table that qualifies for uniqueness of each row/ tuple. • Here in fi»iplo¿ree table Sm ploye e ID & SSN are for a Prim ary Key and thus are Candidate keys. eligible EmgloyeelD EmployeeName • Candidate Keys are super lxeys for which no proper subset SSN is a super hey. In othe r words candidff te k PJS ff J DeptlD minim al super keys. DOB
  • 6. rnate „„,j,| • Candidate column other the Primary column, lilxe if | ir, - ; '- - -. Em ploye elD is set for a PK then SSN would be the J mpl Oyee 1D Alternate hey. EmployeeName SSN DeptlD DOB
  • 7. r g„„,j,| • If you add any other Column /Attribute to a Primary Key |•’ ----- " then it become a Super Key, lilxe Sm ployee ID ' EmgloyeelD +Em ployeeNam e is a Super Key. • Super key stands for superset of a hey. EmployeeName • A Super Key is a set of one or m ore attribute s that are SSN taAe n colle ctive ly and can identify allother attr DeptlD uniquely. DOB
  • 8. • If a table do have a single column that qualifies for a Candidate key, then you have to select 2 or more columns to make a row unique. • Like if there is no E mployeeID or SSN columns, then you can EmployeelD EmployeeName make Em ploye e Nam e + Date O fBirth (DOB) as Composite S ' N Prim ary Key. But stillAae an & a mrrov dlano: A AQi>te revs. Deptio DOB
  • 9. ign g „„,j| • Here in below tables De ptID of De partment table is Primary Key where as De ptID of fi»tplo,;yee is an Foreign Aey. • It means it has referred to another table. This concept is also know as AeJerential Integrity. EmployeelD Employee Name SSN DeptlD DOB DetID DeptName
  • 10. „„,j,| • Unique Aey is same as primary with the diZerence being the existence of null. • Unique hey field allows one value as NULL value. EmployeelD EmployeeName SSN EmaillD DOB