狠狠撸

狠狠撸Share a Scribd company logo
“Data Base “
Name: Sana Salim
Dept: IT
M.Cs 3rd
Topic: Relational Keys
“Table”
? “A table is the primary unit of physical storage
for data in a database.”
? Usually a database contains more than one
table.
“Key Attributes”
? An attribute or set of attributes to identify an
entity instance uniquely
? Types:
– Super key
– Candidate key
– Primary key
– Foreign Key
– Simple or Composite Key
“Example of Key”
StdId StdName Address ClName CurSem
S1020 Suhail Dar Mareer Hassan MCS 4
S1038 Shoaib Baber Model Town BCS 3
S1015 Tahira Ejaz Wah Cantt MCS 2
S1018 Arif Mehmood Satellite Town BIT 4
S1025 Suhail Shah Garhi Shahoo BCS 6
“Simple or Composite Key”
? A key consisting of single attribute is called simple key, e.g.,
StudID, itemNo
? A key consisting of more than one attribute is known as
composite key, like {Program_Code, Course_Code}
ProgCode CourseCode MarksAlloc CrHrs
MCS DS 100 3
MCS DBS 100 3
MBA DBS 100 3
BCS NW 100 3
OFFERING
“Example”
“Primary Key”
? Primary key is a unique identifier of records in
a table.
? None of its attributes can have NULL values
? Primary key values may be generated manually
or automatically.
? A primary key can consist of more than one
field.
“Foreign Key”
foreign key field
primary key field parent table
Directors
Movies
child tablerelationship
“Relationship Types”
? One-to-one
? One-to-many
? Many-to-many
“Super Key”
? Any set of attributes containing a super key is also a super
key since it too uniquely identifies an entity e.g. {StudID,
major}
? For example, for EMPLOYEE and STUDENT entity types
EmpID and StudID are the superkeys respectively.
“Example”
StdId StdName Address ClName CurSem
S1020 Suhail Dar Mareer Hassan MCS 4
S1038 Shoaib Baber Model Town BCS 3
S1015 Tahira Ejaz Wah Cantt MCS 2
S1018 Arif Mehmood Satellite Town BIT 4
S1025 Suhail Shah Garhi Shahoo BCS 6
“Candidate Key”
? A candidate key is the super key that does not
contain extra attributes.
? It might have more than one attribute that uniquely
identifies an entity. e.g {name, address}
“Example”
StdId StdName Address ClName CurSem
S1020 Suhail Dar Mareer Hassan MCS 4
S1038 Shoaib Baber Model Town BCS 3
S1015 Tahira Ejaz Wah Cantt MCS 2
S1018 Arif Mehmood Satellite Town BIT 4
S1025 Suhail Shah Garhi Shahoo BCS 6
Thank you!
Ad

Recommended

Icloud presentation
Icloud presentation
Sana Saleem
?
The relational database model chapter 2
The relational database model chapter 2
Nargis Ehsan
?
3. Relational Models in DBMS
3. Relational Models in DBMS
koolkampus
?
Database : Relational Data Model
Database : Relational Data Model
Smriti Jain
?
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Beat Signer
?
Relational Database Management System
Relational Database Management System
Free Open Source Software Technology Lab
?
Keys and its types in DBMS
Keys and its types in DBMS
Saqlain84
?
Database management systems cs403 power point slides lecture 08
Database management systems cs403 power point slides lecture 08
Md.Abu Sayed
?
B & c
B & c
Vaibhav Kathuria
?
computer-210809080138.pdf
computer-210809080138.pdf
rahulsharma571283
?
Types Of Keys in DBMS
Types Of Keys in DBMS
PadamNepal1
?
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILA
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILA
prashantkori7
?
Keys in Database
Keys in Database
A. S. M. Shafi
?
2.2 keys
2.2 keys
ELIMENG
?
Keys.pptx
Keys.pptx
revathi s
?
Advance database system (part 3)
Advance database system (part 3)
Abdullah Khosa
?
DBMS key topic Presentation slide 1.pptx
DBMS key topic Presentation slide 1.pptx
sonudhakad173
?
Dbms keys
Dbms keys
RUpaliLohar
?
DBMS Structure of Relational Databases.pptx
DBMS Structure of Relational Databases.pptx
ssuser19199c
?
Types of keys in dbms
Types of keys in dbms
darshhingu
?
Database manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasan
Sheikh Monirul Hasan
?
Relational database Management system.pptx
Relational database Management system.pptx
RevathiNCommerceCSCA
?
Key and its different types
Key and its different types
Umair Shakir
?
Presentation OF DBMS-2.pptx
Presentation OF DBMS-2.pptx
ShumailaSajjad
?
relational data model in RDBMS USING KEYS.pptx
relational data model in RDBMS USING KEYS.pptx
urvashipundir04
?
relational data model In rdbms keys.pptx
relational data model In rdbms keys.pptx
urvashipundir04
?
relational data model in DBMS AND KEYS.pptx
relational data model in DBMS AND KEYS.pptx
urvashipundir04
?
RELATIONALfsaaaaaaaaaaaakyagsgs MODEL.pptx
RELATIONALfsaaaaaaaaaaaakyagsgs MODEL.pptx
satish7588
?
BCG-Executive-Perspectives-CEOs-Guide-to-Maximizing-Value-from-AI-EP0-3July20...
BCG-Executive-Perspectives-CEOs-Guide-to-Maximizing-Value-from-AI-EP0-3July20...
benediktnetzer1
?
ppt somu_Jarvis_AI_Assistant_presen.pptx
ppt somu_Jarvis_AI_Assistant_presen.pptx
MohammedumarFarhan
?

More Related Content

Similar to Data base (20)

B & c
B & c
Vaibhav Kathuria
?
computer-210809080138.pdf
computer-210809080138.pdf
rahulsharma571283
?
Types Of Keys in DBMS
Types Of Keys in DBMS
PadamNepal1
?
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILA
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILA
prashantkori7
?
Keys in Database
Keys in Database
A. S. M. Shafi
?
2.2 keys
2.2 keys
ELIMENG
?
Keys.pptx
Keys.pptx
revathi s
?
Advance database system (part 3)
Advance database system (part 3)
Abdullah Khosa
?
DBMS key topic Presentation slide 1.pptx
DBMS key topic Presentation slide 1.pptx
sonudhakad173
?
Dbms keys
Dbms keys
RUpaliLohar
?
DBMS Structure of Relational Databases.pptx
DBMS Structure of Relational Databases.pptx
ssuser19199c
?
Types of keys in dbms
Types of keys in dbms
darshhingu
?
Database manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasan
Sheikh Monirul Hasan
?
Relational database Management system.pptx
Relational database Management system.pptx
RevathiNCommerceCSCA
?
Key and its different types
Key and its different types
Umair Shakir
?
Presentation OF DBMS-2.pptx
Presentation OF DBMS-2.pptx
ShumailaSajjad
?
relational data model in RDBMS USING KEYS.pptx
relational data model in RDBMS USING KEYS.pptx
urvashipundir04
?
relational data model In rdbms keys.pptx
relational data model In rdbms keys.pptx
urvashipundir04
?
relational data model in DBMS AND KEYS.pptx
relational data model in DBMS AND KEYS.pptx
urvashipundir04
?
RELATIONALfsaaaaaaaaaaaakyagsgs MODEL.pptx
RELATIONALfsaaaaaaaaaaaakyagsgs MODEL.pptx
satish7588
?
Types Of Keys in DBMS
Types Of Keys in DBMS
PadamNepal1
?
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILA
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILA
prashantkori7
?
Advance database system (part 3)
Advance database system (part 3)
Abdullah Khosa
?
DBMS key topic Presentation slide 1.pptx
DBMS key topic Presentation slide 1.pptx
sonudhakad173
?
DBMS Structure of Relational Databases.pptx
DBMS Structure of Relational Databases.pptx
ssuser19199c
?
Types of keys in dbms
Types of keys in dbms
darshhingu
?
Database manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasan
Sheikh Monirul Hasan
?
Relational database Management system.pptx
Relational database Management system.pptx
RevathiNCommerceCSCA
?
Key and its different types
Key and its different types
Umair Shakir
?
Presentation OF DBMS-2.pptx
Presentation OF DBMS-2.pptx
ShumailaSajjad
?
relational data model in RDBMS USING KEYS.pptx
relational data model in RDBMS USING KEYS.pptx
urvashipundir04
?
relational data model In rdbms keys.pptx
relational data model In rdbms keys.pptx
urvashipundir04
?
relational data model in DBMS AND KEYS.pptx
relational data model in DBMS AND KEYS.pptx
urvashipundir04
?
RELATIONALfsaaaaaaaaaaaakyagsgs MODEL.pptx
RELATIONALfsaaaaaaaaaaaakyagsgs MODEL.pptx
satish7588
?

Recently uploaded (20)

BCG-Executive-Perspectives-CEOs-Guide-to-Maximizing-Value-from-AI-EP0-3July20...
BCG-Executive-Perspectives-CEOs-Guide-to-Maximizing-Value-from-AI-EP0-3July20...
benediktnetzer1
?
ppt somu_Jarvis_AI_Assistant_presen.pptx
ppt somu_Jarvis_AI_Assistant_presen.pptx
MohammedumarFarhan
?
presentation4.pdf Intro to mcmc methodss
presentation4.pdf Intro to mcmc methodss
SergeyTsygankov6
?
Lesson-3_Program-Outcomes-and-Student-Learning-Outcomes_For-Students.pdf
Lesson-3_Program-Outcomes-and-Student-Learning-Outcomes_For-Students.pdf
SarahMaeDuallo
?
deep_learning_presentation related to llm
deep_learning_presentation related to llm
sayedabdussalam11
?
最新版美国芝加哥大学毕业证(鲍颁丑颈肠补驳辞毕业证书)原版定制
最新版美国芝加哥大学毕业证(鲍颁丑颈肠补驳辞毕业证书)原版定制
taqyea
?
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
Tamanna36
?
一比一原版(罢鲍颁毕业证书)开姆尼茨工业大学毕业证如何办理
一比一原版(罢鲍颁毕业证书)开姆尼茨工业大学毕业证如何办理
taqyed
?
Camuflaje Tipos Características Militar 2025.ppt
Camuflaje Tipos Características Militar 2025.ppt
e58650738
?
定制翱颁础顿学生卡加拿大安大略艺术与设计大学成绩单范本,翱颁础顿成绩单复刻
定制翱颁础顿学生卡加拿大安大略艺术与设计大学成绩单范本,翱颁础顿成绩单复刻
taqyed
?
Flextronics Employee Safety Data-Project-2.pptx
Flextronics Employee Safety Data-Project-2.pptx
kilarihemadri
?
PPT2 W1L2.pptx.........................................
PPT2 W1L2.pptx.........................................
palicteronalyn26
?
Residential Zone 4 for industrial village
Residential Zone 4 for industrial village
MdYasinArafat13
?
Starbucks in the Indian market through its joint venture.
Starbucks in the Indian market through its joint venture.
sales480687
?
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪尝闯惭鲍学生证办理学历认证
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪尝闯惭鲍学生证办理学历认证
taqyed
?
UPS and Big Data intro to Business Analytics.pptx
UPS and Big Data intro to Business Analytics.pptx
sanjum5582
?
最新版意大利米兰大学毕业证(鲍狈滨惭滨毕业证书)原版定制
最新版意大利米兰大学毕业证(鲍狈滨惭滨毕业证书)原版定制
taqyea
?
NASA ESE Study Results v4 05.29.2020.pptx
NASA ESE Study Results v4 05.29.2020.pptx
CiroAlejandroCamacho
?
Crafting-Research-Recommendations Grade 12.pptx
Crafting-Research-Recommendations Grade 12.pptx
DaryllWhere
?
Statistics-and-Computer-Tools-for-Analyzing-of-Assessment-Data.pptx
Statistics-and-Computer-Tools-for-Analyzing-of-Assessment-Data.pptx
pelaezmaryjoy90
?
BCG-Executive-Perspectives-CEOs-Guide-to-Maximizing-Value-from-AI-EP0-3July20...
BCG-Executive-Perspectives-CEOs-Guide-to-Maximizing-Value-from-AI-EP0-3July20...
benediktnetzer1
?
ppt somu_Jarvis_AI_Assistant_presen.pptx
ppt somu_Jarvis_AI_Assistant_presen.pptx
MohammedumarFarhan
?
presentation4.pdf Intro to mcmc methodss
presentation4.pdf Intro to mcmc methodss
SergeyTsygankov6
?
Lesson-3_Program-Outcomes-and-Student-Learning-Outcomes_For-Students.pdf
Lesson-3_Program-Outcomes-and-Student-Learning-Outcomes_For-Students.pdf
SarahMaeDuallo
?
deep_learning_presentation related to llm
deep_learning_presentation related to llm
sayedabdussalam11
?
最新版美国芝加哥大学毕业证(鲍颁丑颈肠补驳辞毕业证书)原版定制
最新版美国芝加哥大学毕业证(鲍颁丑颈肠补驳辞毕业证书)原版定制
taqyea
?
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
Tamanna36
?
一比一原版(罢鲍颁毕业证书)开姆尼茨工业大学毕业证如何办理
一比一原版(罢鲍颁毕业证书)开姆尼茨工业大学毕业证如何办理
taqyed
?
Camuflaje Tipos Características Militar 2025.ppt
Camuflaje Tipos Características Militar 2025.ppt
e58650738
?
定制翱颁础顿学生卡加拿大安大略艺术与设计大学成绩单范本,翱颁础顿成绩单复刻
定制翱颁础顿学生卡加拿大安大略艺术与设计大学成绩单范本,翱颁础顿成绩单复刻
taqyed
?
Flextronics Employee Safety Data-Project-2.pptx
Flextronics Employee Safety Data-Project-2.pptx
kilarihemadri
?
PPT2 W1L2.pptx.........................................
PPT2 W1L2.pptx.........................................
palicteronalyn26
?
Residential Zone 4 for industrial village
Residential Zone 4 for industrial village
MdYasinArafat13
?
Starbucks in the Indian market through its joint venture.
Starbucks in the Indian market through its joint venture.
sales480687
?
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪尝闯惭鲍学生证办理学历认证
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪尝闯惭鲍学生证办理学历认证
taqyed
?
UPS and Big Data intro to Business Analytics.pptx
UPS and Big Data intro to Business Analytics.pptx
sanjum5582
?
最新版意大利米兰大学毕业证(鲍狈滨惭滨毕业证书)原版定制
最新版意大利米兰大学毕业证(鲍狈滨惭滨毕业证书)原版定制
taqyea
?
NASA ESE Study Results v4 05.29.2020.pptx
NASA ESE Study Results v4 05.29.2020.pptx
CiroAlejandroCamacho
?
Crafting-Research-Recommendations Grade 12.pptx
Crafting-Research-Recommendations Grade 12.pptx
DaryllWhere
?
Statistics-and-Computer-Tools-for-Analyzing-of-Assessment-Data.pptx
Statistics-and-Computer-Tools-for-Analyzing-of-Assessment-Data.pptx
pelaezmaryjoy90
?
Ad

Data base

  • 1. “Data Base “ Name: Sana Salim Dept: IT M.Cs 3rd Topic: Relational Keys
  • 2. “Table” ? “A table is the primary unit of physical storage for data in a database.” ? Usually a database contains more than one table.
  • 3. “Key Attributes” ? An attribute or set of attributes to identify an entity instance uniquely ? Types: – Super key – Candidate key – Primary key – Foreign Key – Simple or Composite Key
  • 4. “Example of Key” StdId StdName Address ClName CurSem S1020 Suhail Dar Mareer Hassan MCS 4 S1038 Shoaib Baber Model Town BCS 3 S1015 Tahira Ejaz Wah Cantt MCS 2 S1018 Arif Mehmood Satellite Town BIT 4 S1025 Suhail Shah Garhi Shahoo BCS 6
  • 5. “Simple or Composite Key” ? A key consisting of single attribute is called simple key, e.g., StudID, itemNo ? A key consisting of more than one attribute is known as composite key, like {Program_Code, Course_Code}
  • 6. ProgCode CourseCode MarksAlloc CrHrs MCS DS 100 3 MCS DBS 100 3 MBA DBS 100 3 BCS NW 100 3 OFFERING “Example”
  • 7. “Primary Key” ? Primary key is a unique identifier of records in a table. ? None of its attributes can have NULL values ? Primary key values may be generated manually or automatically. ? A primary key can consist of more than one field.
  • 8. “Foreign Key” foreign key field primary key field parent table Directors Movies child tablerelationship
  • 9. “Relationship Types” ? One-to-one ? One-to-many ? Many-to-many
  • 10. “Super Key” ? Any set of attributes containing a super key is also a super key since it too uniquely identifies an entity e.g. {StudID, major} ? For example, for EMPLOYEE and STUDENT entity types EmpID and StudID are the superkeys respectively.
  • 11. “Example” StdId StdName Address ClName CurSem S1020 Suhail Dar Mareer Hassan MCS 4 S1038 Shoaib Baber Model Town BCS 3 S1015 Tahira Ejaz Wah Cantt MCS 2 S1018 Arif Mehmood Satellite Town BIT 4 S1025 Suhail Shah Garhi Shahoo BCS 6
  • 12. “Candidate Key” ? A candidate key is the super key that does not contain extra attributes. ? It might have more than one attribute that uniquely identifies an entity. e.g {name, address}
  • 13. “Example” StdId StdName Address ClName CurSem S1020 Suhail Dar Mareer Hassan MCS 4 S1038 Shoaib Baber Model Town BCS 3 S1015 Tahira Ejaz Wah Cantt MCS 2 S1018 Arif Mehmood Satellite Town BIT 4 S1025 Suhail Shah Garhi Shahoo BCS 6