SlideShare una empresa de Scribd logo
1 de 15
INTRODUCTION

 There are some instances when a
  primary key doesn’t exist in the
  real world or when the existing
natural key might not be a suitable
           primary key.
SURROGATE KEY:

Is a primary key created by
the database designer to
simplify the identification of
entity instances.
ADVANTAGE

Since it has no intrinsic meaning,
values for it can be generated by
the DBMS to ensure that unique
values are always provided.
TABLE 5.4


  DATE       TIME_START   TIME_END   ROOM      EVENT_NAME      PARTY_OF

6/17/2010     11:00AM      2:00PM    Allure      Burton           60
                                                 Wedding
6/17/2010     11:00AM      2:00PM    Bonanza   Adams Office       12

6/17/2010     3:00PM       5:30PM     Allure   Smith Family       15

6/17/2010     3:30PM       5:30PM    Bonanza   Adam’s Office      12

6/18/2010     1:00PM       3:00PM    Bonanza    Boy Scouts        33

6/18/2010     11:00AM      2:00PM     Allure     March of         25
                                                  Dines
6/18/2010     11:00AM     12:30PM    Bonanza   Smith Family       12
 Given the data shown in table 5.4 you would
          model the EVENT entity as:

EVENT(DATE, TIME_START, TIME_END,ROOM
        ,EVENT_NAME,PARTY_OF)
DATE TIME_ TIME        ROOM      EVENT_     PART
     START _EN                    NAME      Y_OF   What primary key would you
             D                                     suggest? In this case , there is no
6/17 11:00 2:00        Allure    Burton      60    simple natural key that could be
 /10  AM    PM                   Wedding
                                                   used as a primary key in the
6/17/   11:00   2:00   Bonanza   Adams       12    model. Based on the primary key
 10      AM     PM               Office            concepts you learned about in
                                                   previous chapters, you might
6/17/   3:00    5:30    Allure    Smith      15    suggest one of these options.
 10     PM      PM                Family

6/17/   3:30    5:30   Bonanza   Adam’s      12
 10     PM      PM                Office

                                                       (DATE, TIME_START, ROOM)
6/18/   1:00    3:00   Bonanza     Boy       33                    Or
 10     PM      PM                Scouts                (DATE, TIME_END, ROOM)
6/18/   11:00   2:00    Allure   March of    25
 10      AM     PM                Dines
6/18/   11:00   12:3 Bonanza      Smith      12
 10      AM     0PM               Family
DAT TIME_      TIME_   ROO      EVENT_     PART
 E  START       END     M        NAME      Y_OF        Assume you select the
                                                  composite primary key (DATE,
                                                  TIME_START,ROOM) for the
6/17   11:00   2:00P   Allure   Burton      60    EVENT entity. Next ,you
/10     AM       M              Wedding
                                                  determine that one EVENT may
6/17   11:00   2:00P   Bonan    Adams       12    use many RESOURCES such as
/10     AM       M       za     Office            tables, projectors, pc and
                                                  stands, and that the same
6/17   3:00    5:30P   Allure    Smith      15    RESOURCE may be use for
/10    PM        M               Family           many EVENTS. The RESOURCE
                                                  entity would be represented by
6/17   3:30    5:30P   Bonan    Adam’s      12    the ff. attributes:
/10    PM        M       za      Office

6/18   1:00    3:00P   Bonan      Boy       33    RESOURCE (RSC_ID,
/10    PM        M       za      Scouts           RSC_DESCRIPTION,RSC_T
6/18   11:00   2:00P   Allure   March of    25    YPE, RSC_QTY,RSC_PRICE)
/10     AM       M               Dines
6/18   11:00   12:30   Bonan     Smith      12
/10     AM      PM       za      Family
DATE TIME_ TIME        ROOM     EVENT      PART
     START _EN                  _NAME      Y_OF   Given the business rules, the M:N
             D                                    relationship between RESOURCE
                                                  and EVENT would be represented
6/17   11:00   2:00P   Allure   Burton      60
                                                  via the EVNTRSC composite entity
/10     AM       M              Wedding
                                                  with a composite primary key as
6/17   11:00   2:00P   Bonan    Adams       12    follows:
/10     AM       M       za     Office
                                                    EVNTRSC (DATE, TIME _START,
6/17   3:00    5:30P   Allure    Smith      15      ROOM, RSC_ID, QTY _USED
/10    PM        M               Family
                                                   You now have a lengthy four-
6/17   3:30    5:30P   Bonan    Adam’s      12     attribute composite primary key.
/10    PM        M       za      Office            What would happen if the
                                                   EVNTRSC entity’s primary key
                                                   were inherited by another
6/18   1:00    3:00P   Bonan      Boy       33     existence dependent entity? At
/10    PM        M       za      Scouts            this point, you can see that the
6/18   11:00   2:00P   Allure   March of    25     composite primary key could
/10     AM       M               Dines             make the implementation of the
                                                   database and program coding
6/18   11:00   12:30   Bonan     Smith      12
                                                   unnecessarily complex.
/10     AM      PM       za      Family
Surrogate primary keys are accepted
   practice in today's complex data
            environments.
They are especially helpful when there
  is no natural key, when the selected
 candidate key has embedded semantic
     contents or when the selected
       candidate key is too long or
             cumbersome.
However , there is a trade-off; if you use
  a surrogate key, you must ensure that
     the candidate key of the entity in
 question performs properly through the
  use of “unique index” and “not null”
               constraints.
PREPARED BY:




   ROSELYN P. CEA
ALLYSA JANE CATALLA
      BLIS -III

Más contenido relacionado

Último

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Catalla & cea

  • 1.
  • 2. INTRODUCTION There are some instances when a primary key doesn’t exist in the real world or when the existing natural key might not be a suitable primary key.
  • 3. SURROGATE KEY: Is a primary key created by the database designer to simplify the identification of entity instances.
  • 4.
  • 5. ADVANTAGE Since it has no intrinsic meaning, values for it can be generated by the DBMS to ensure that unique values are always provided.
  • 6.
  • 7. TABLE 5.4 DATE TIME_START TIME_END ROOM EVENT_NAME PARTY_OF 6/17/2010 11:00AM 2:00PM Allure Burton 60 Wedding 6/17/2010 11:00AM 2:00PM Bonanza Adams Office 12 6/17/2010 3:00PM 5:30PM Allure Smith Family 15 6/17/2010 3:30PM 5:30PM Bonanza Adam’s Office 12 6/18/2010 1:00PM 3:00PM Bonanza Boy Scouts 33 6/18/2010 11:00AM 2:00PM Allure March of 25 Dines 6/18/2010 11:00AM 12:30PM Bonanza Smith Family 12
  • 8.  Given the data shown in table 5.4 you would model the EVENT entity as: EVENT(DATE, TIME_START, TIME_END,ROOM ,EVENT_NAME,PARTY_OF)
  • 9. DATE TIME_ TIME ROOM EVENT_ PART START _EN NAME Y_OF What primary key would you D suggest? In this case , there is no 6/17 11:00 2:00 Allure Burton 60 simple natural key that could be /10 AM PM Wedding used as a primary key in the 6/17/ 11:00 2:00 Bonanza Adams 12 model. Based on the primary key 10 AM PM Office concepts you learned about in previous chapters, you might 6/17/ 3:00 5:30 Allure Smith 15 suggest one of these options. 10 PM PM Family 6/17/ 3:30 5:30 Bonanza Adam’s 12 10 PM PM Office (DATE, TIME_START, ROOM) 6/18/ 1:00 3:00 Bonanza Boy 33 Or 10 PM PM Scouts (DATE, TIME_END, ROOM) 6/18/ 11:00 2:00 Allure March of 25 10 AM PM Dines 6/18/ 11:00 12:3 Bonanza Smith 12 10 AM 0PM Family
  • 10. DAT TIME_ TIME_ ROO EVENT_ PART E START END M NAME Y_OF Assume you select the composite primary key (DATE, TIME_START,ROOM) for the 6/17 11:00 2:00P Allure Burton 60 EVENT entity. Next ,you /10 AM M Wedding determine that one EVENT may 6/17 11:00 2:00P Bonan Adams 12 use many RESOURCES such as /10 AM M za Office tables, projectors, pc and stands, and that the same 6/17 3:00 5:30P Allure Smith 15 RESOURCE may be use for /10 PM M Family many EVENTS. The RESOURCE entity would be represented by 6/17 3:30 5:30P Bonan Adam’s 12 the ff. attributes: /10 PM M za Office 6/18 1:00 3:00P Bonan Boy 33 RESOURCE (RSC_ID, /10 PM M za Scouts RSC_DESCRIPTION,RSC_T 6/18 11:00 2:00P Allure March of 25 YPE, RSC_QTY,RSC_PRICE) /10 AM M Dines 6/18 11:00 12:30 Bonan Smith 12 /10 AM PM za Family
  • 11. DATE TIME_ TIME ROOM EVENT PART START _EN _NAME Y_OF Given the business rules, the M:N D relationship between RESOURCE and EVENT would be represented 6/17 11:00 2:00P Allure Burton 60 via the EVNTRSC composite entity /10 AM M Wedding with a composite primary key as 6/17 11:00 2:00P Bonan Adams 12 follows: /10 AM M za Office EVNTRSC (DATE, TIME _START, 6/17 3:00 5:30P Allure Smith 15 ROOM, RSC_ID, QTY _USED /10 PM M Family You now have a lengthy four- 6/17 3:30 5:30P Bonan Adam’s 12 attribute composite primary key. /10 PM M za Office What would happen if the EVNTRSC entity’s primary key were inherited by another 6/18 1:00 3:00P Bonan Boy 33 existence dependent entity? At /10 PM M za Scouts this point, you can see that the 6/18 11:00 2:00P Allure March of 25 composite primary key could /10 AM M Dines make the implementation of the database and program coding 6/18 11:00 12:30 Bonan Smith 12 unnecessarily complex. /10 AM PM za Family
  • 12. Surrogate primary keys are accepted practice in today's complex data environments.
  • 13. They are especially helpful when there is no natural key, when the selected candidate key has embedded semantic contents or when the selected candidate key is too long or cumbersome.
  • 14. However , there is a trade-off; if you use a surrogate key, you must ensure that the candidate key of the entity in question performs properly through the use of “unique index” and “not null” constraints.
  • 15. PREPARED BY: ROSELYN P. CEA ALLYSA JANE CATALLA BLIS -III