SlideShare une entreprise Scribd logo
1  sur  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         ROOM     EVENT_     PART
 E  START _EN                    NAME      Y_OF        Assume you select the
            D                                     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
/10    PM        M       za      Scouts           (RSC_ID, RSC_DESCRIPTIO
6/18   11:00   2:00P   Allure   March of    25    N,RSC_TYPE, RSC_QTY,RS
/10     AM       M               Dines            C_PRICE)
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:00    Allure   Burton    60
                                                via the EVNTRSC composite entity
/10     AM     PM               Weddi
                                                with a composite primary key as
                                  ng
                                                follows:
6/17   11:00   2:00   Bonanza   Adams     12
/10     AM     PM               Office            EVNTRSC (DATE, TIME
                                                  _START, ROOM, RSC_ID, QTY
6/17   3:00    5:30    Allure   Smith     15      _USED
/10    PM      PM               Family           You now have a lengthy four-
                                                 attribute composite primary key.
6/17   3:30    5:30   Bonanza Adam’s      12     What would happen if the
/10    PM      PM              Office            EVNTRSC entity’s primary key
                                                 were inherited by another
                                                 existence dependent entity? At
6/18   1:00    3:00   Bonanza    Boy      33     this point, you can see that the
/10    PM      PM               Scouts           composite primary key could
6/18   11:00   2:00    Allure   March     25     make the implementation of the
/10     AM     PM                of              database and program coding
                                Dines            unnecessarily complex.
6/18   11:00   12:3   Bonanza   Smith     12
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

Contenu connexe

En vedette

Indexing languages
Indexing languagesIndexing languages
Indexing languagesyhen06
 
web tech
web techweb tech
web techyhen06
 
Markey encyclopedia
Markey encyclopediaMarkey encyclopedia
Markey encyclopediayhen06
 
Hardware & software
Hardware & softwareHardware & software
Hardware & softwareyhen06
 
Evaluating different sources
Evaluating different sourcesEvaluating different sources
Evaluating different sourcesyhen06
 
Project proposal final presentation
Project proposal  final presentationProject proposal  final presentation
Project proposal final presentationyhen06
 
Informational web pages
Informational web pagesInformational web pages
Informational web pagesyhen06
 
Basic education department library
Basic education department libraryBasic education department library
Basic education department libraryyhen06
 

En vedette (8)

Indexing languages
Indexing languagesIndexing languages
Indexing languages
 
web tech
web techweb tech
web tech
 
Markey encyclopedia
Markey encyclopediaMarkey encyclopedia
Markey encyclopedia
 
Hardware & software
Hardware & softwareHardware & software
Hardware & software
 
Evaluating different sources
Evaluating different sourcesEvaluating different sources
Evaluating different sources
 
Project proposal final presentation
Project proposal  final presentationProject proposal  final presentation
Project proposal final presentation
 
Informational web pages
Informational web pagesInformational web pages
Informational web pages
 
Basic education department library
Basic education department libraryBasic education department library
Basic education department library
 

Plus de yhen06

Story telling
Story tellingStory telling
Story tellingyhen06
 
National book week celebration
National book week celebrationNational book week celebration
National book week celebrationyhen06
 
Book fair
Book fairBook fair
Book fairyhen06
 
Indexing languages (2)
Indexing languages (2)Indexing languages (2)
Indexing languages (2)yhen06
 
Importance of database design (1)
Importance of database design (1)Importance of database design (1)
Importance of database design (1)yhen06
 
Database system environment ppt.
Database system environment ppt.Database system environment ppt.
Database system environment ppt.yhen06
 
Dictionary aizel
Dictionary aizelDictionary aizel
Dictionary aizelyhen06
 
Book of days and first - aubrey
Book of days and first  - aubreyBook of days and first  - aubrey
Book of days and first - aubreyyhen06
 
Bibliographies (2)
Bibliographies (2)Bibliographies (2)
Bibliographies (2)yhen06
 
Database system environment ppt.
Database system environment ppt.Database system environment ppt.
Database system environment ppt.yhen06
 
Advantages and disadvantages of digital library
Advantages and disadvantages of digital libraryAdvantages and disadvantages of digital library
Advantages and disadvantages of digital libraryyhen06
 
Importance of data model
Importance of data modelImportance of data model
Importance of data modelyhen06
 
General factbooks
General factbooksGeneral factbooks
General factbooksyhen06
 
Evaluating different sources maam she
Evaluating different sources maam sheEvaluating different sources maam she
Evaluating different sources maam sheyhen06
 
Nature of information
Nature of informationNature of information
Nature of informationyhen06
 
Advantages and disadvantages of digital library
Advantages and disadvantages of digital libraryAdvantages and disadvantages of digital library
Advantages and disadvantages of digital libraryyhen06
 
Database management functions
Database management functionsDatabase management functions
Database management functionsyhen06
 
Indexing languages
Indexing languagesIndexing languages
Indexing languagesyhen06
 
Evaluating web resources
Evaluating web resourcesEvaluating web resources
Evaluating web resourcesyhen06
 
Project proposal final presentation2
Project proposal  final presentation2Project proposal  final presentation2
Project proposal final presentation2yhen06
 

Plus de yhen06 (20)

Story telling
Story tellingStory telling
Story telling
 
National book week celebration
National book week celebrationNational book week celebration
National book week celebration
 
Book fair
Book fairBook fair
Book fair
 
Indexing languages (2)
Indexing languages (2)Indexing languages (2)
Indexing languages (2)
 
Importance of database design (1)
Importance of database design (1)Importance of database design (1)
Importance of database design (1)
 
Database system environment ppt.
Database system environment ppt.Database system environment ppt.
Database system environment ppt.
 
Dictionary aizel
Dictionary aizelDictionary aizel
Dictionary aizel
 
Book of days and first - aubrey
Book of days and first  - aubreyBook of days and first  - aubrey
Book of days and first - aubrey
 
Bibliographies (2)
Bibliographies (2)Bibliographies (2)
Bibliographies (2)
 
Database system environment ppt.
Database system environment ppt.Database system environment ppt.
Database system environment ppt.
 
Advantages and disadvantages of digital library
Advantages and disadvantages of digital libraryAdvantages and disadvantages of digital library
Advantages and disadvantages of digital library
 
Importance of data model
Importance of data modelImportance of data model
Importance of data model
 
General factbooks
General factbooksGeneral factbooks
General factbooks
 
Evaluating different sources maam she
Evaluating different sources maam sheEvaluating different sources maam she
Evaluating different sources maam she
 
Nature of information
Nature of informationNature of information
Nature of information
 
Advantages and disadvantages of digital library
Advantages and disadvantages of digital libraryAdvantages and disadvantages of digital library
Advantages and disadvantages of digital library
 
Database management functions
Database management functionsDatabase management functions
Database management functions
 
Indexing languages
Indexing languagesIndexing languages
Indexing languages
 
Evaluating web resources
Evaluating web resourcesEvaluating web resources
Evaluating web resources
 
Project proposal final presentation2
Project proposal  final presentation2Project proposal  final presentation2
Project proposal final presentation2
 

Dernier

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Dernier (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

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 ROOM EVENT_ PART E START _EN NAME Y_OF Assume you select the D 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 /10 PM M za Scouts (RSC_ID, RSC_DESCRIPTIO 6/18 11:00 2:00P Allure March of 25 N,RSC_TYPE, RSC_QTY,RS /10 AM M Dines C_PRICE) 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:00 Allure Burton 60 via the EVNTRSC composite entity /10 AM PM Weddi with a composite primary key as ng follows: 6/17 11:00 2:00 Bonanza Adams 12 /10 AM PM Office EVNTRSC (DATE, TIME _START, ROOM, RSC_ID, QTY 6/17 3:00 5:30 Allure Smith 15 _USED /10 PM PM Family You now have a lengthy four- attribute composite primary key. 6/17 3:30 5:30 Bonanza Adam’s 12 What would happen if the /10 PM PM Office EVNTRSC entity’s primary key were inherited by another existence dependent entity? At 6/18 1:00 3:00 Bonanza Boy 33 this point, you can see that the /10 PM PM Scouts composite primary key could 6/18 11:00 2:00 Allure March 25 make the implementation of the /10 AM PM of database and program coding Dines unnecessarily complex. 6/18 11:00 12:3 Bonanza Smith 12
  • 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