SlideShare a Scribd company logo
1 of 19
Database Design

Objectives
In this lesson, you will learn to:
 Map an entity-relationship diagram to tables in relation to the
  following:
     Regular entities
     Attributes
     Relationships
     Weak entities
     Subtypes and supertypes



©NIIT                                       RDBMS/Lesson 2/Slide 1 of 19
Database Design

Conceptual Model
 Reflects entities and their relationships, based on the data
  processing needs of an organization
 Can be mapped to a relational, hierarchical, or network
  model
 Is independent of individual applications, database
  management systems, hardware, and physical storage of
  data




©NIIT                                       RDBMS/Lesson 2/Slide 2 of 19
Database Design

Mapping Entity-Relationship Diagrams to Tables
 A database that conforms to an E/R diagram can be
  represented by a collection of tables in the relational system
 The mapping of E/R diagrams to tables can be discussed in
  relation to the following:
     Regular entities
     Attributes
     Relationships
     Weak entities
     Subtypes and Supertypes

©NIIT                                       RDBMS/Lesson 2/Slide 3 of 19
Database Design

Regular Entities
 They can exist in isolation, independent of any other entity
 They are the “building blocks” of the database
 Each regular entity maps to a table




©NIIT                                       RDBMS/Lesson 2/Slide 4 of 19
Database Design

Attributes
 Each property or attribute shown in the E/R diagram
  maps to a column in the appropriate table




©NIIT                                     RDBMS/Lesson 2/Slide 5 of 19
Database Design

Relationships
 Each type of relationship maps to tables in a different
  manner in the relational database management system
 The most important principle is to create tables where
  information from the real world is stored and retrieved in an
  optimal way; that is, a minimum number of tables with a
  minimum number of attributes
 In a relational system, a join operation retrieves all
  information by combining two or more tables




©NIIT                                        RDBMS/Lesson 2/Slide 6 of 19
Database Design

Relationships (Contd.)
 Are of the following types:
     One-to-One
     One-to-Many
     Many-to-Many




©NIIT                           RDBMS/Lesson 2/Slide 7 of 19
Database Design

Weak Entities
 A weak entity is an entity whose existence depends on
  some other entity
 It cannot exist if the entity on which it depends does not
  exist




©NIIT                                       RDBMS/Lesson 2/Slide 8 of 19
Database Design

Subtypes and Supertypes
 Each entity type (subtypes and supertypes) maps to a
  separate table
 The primary key of the supertype is the foreign key of the
  subtype
     It creates a link between the two
     The foreign key of the subtype is also its primary key




©NIIT                                       RDBMS/Lesson 2/Slide 9 of 19
Database Design

Tips on Logical Database Design
 Attributes:
     Do not introduce any unnecessary attributes
     An attribute serves three purposes:
        ® To   identify its owner entity
        ® To   refer to another entity
        ® To   simplify the description of an entity




©NIIT                                          RDBMS/Lesson 2/Slide 10 of 19
Database Design

Tips on Logical Database Design (Contd.)
 Keys:
     Relational systems require keys that uniquely identify the
      rows of a table.
     There are various types of keys:
        ® Primary

        ® Foreign

        ® Candidate

        ® Alternate

        ® Composite


©NIIT                                      RDBMS/Lesson 2/Slide 11 of 19
Database Design

Tips on Logical Database Design (Contd.)
     Any attribute (or set of attributes) that uniquely
      identifies a row in a table is a candidate for the
      primary key. Such an attribute is called a
      candidate key.
     Any attribute that is a candidate for the primary key but is
      not the primary key is called the alternate key.
     Keys can be simple or composite
        ®A   simple key is composed of a single attribute
        ®Acomposite key, on the other hand, comprises two or
         more attributes

©NIIT                                        RDBMS/Lesson 2/Slide 12 of 19
Database Design

Just a Minute…
 Define the following terms:
    a. Candidate Key
    b. Alternate Key


 




©NIIT                           RDBMS/Lesson 2/Slide 13 of 19
Database Design

Tips on Logical Database Design (Contd.)
 Entities:
     Some attributes may acquire further attributes during
      database design and become entities.
 Subentities:
     Replace optional attributes of an entity with subentities.
      This is called specialization.
     Specialization is the result of taking a subset of a higher-
      level entity set to form a lower-level entity set
     Generalization is the result of taking the union of two or
      more lower-level entity sets to produce a higher‑level
      entity set.

©NIIT                                       RDBMS/Lesson 2/Slide 14 of 19
Database Design

Problem Statement 2.P.1
 Map the E/R diagram to its corresponding tables




©NIIT                                   RDBMS/Lesson 2/Slide 15 of 19
Database Design

Summary
In this lesson, you learned that:
 The conceptual model reflects entities and their
  relationships. Data analysis helps determine entities and
  relationships. The conceptual model is independent of the
  system where it is to be implemented.
 Regular entities are not dependent. They can exist in
  isolation, independent of any other entity.
 Each entity maps to a table. Each attribute in an E/R
  diagram maps to an attribute in a table.
 Entities with common attributes should be merged. Attributes
  may acquire further attributes and become entities.
©NIIT                                     RDBMS/Lesson 2/Slide 16 of 19
Database Design

Summary (Contd.)
 The mapping of relationships depends on the type of
  relationship. Each type of relationship maps to tables in a
  different manner in the relational database management
  system.
 In one-to-one relationships, one instance of an entity can
  relate to only one instance of the related entity.
 In a one-to-many relationship, one instance of an entity can
  relate to more than one instance of the related entity.
 Many-to-many relationships map to tables.
 One-to-one relationships are not very common and may map
  to foreign keys in tables.

©NIIT                                      RDBMS/Lesson 2/Slide 17 of 19
Database Design

Summary (Contd.)
 A weak entity is an entity whose existence depends on some
  other entity.
 A subtype is a subset of another entity. A subtype is always
  dependent on supertype for its existence.
 The primary key of the supertype is the foreign key of the
  subtype. It creates a link between the two.
 A candidate key is a candidate for the primary key. An
  alternate key is a candidate key that is not a primary key.
 Optional attributes should be replaced with subentities; this
  is also called specialization.


©NIIT                                      RDBMS/Lesson 2/Slide 18 of 19
Database Design

Summary (Contd.)
 To simplify multiple references, a new superentity should be
  introduced; this is also called generalization.




©NIIT                                    RDBMS/Lesson 2/Slide 19 of 19

More Related Content

What's hot

Dbms interview questions s.pdf
Dbms interview questions s.pdfDbms interview questions s.pdf
Dbms interview questions s.pdfShivani139202
 
database chap 1 and 2.pptx
database chap 1 and 2.pptxdatabase chap 1 and 2.pptx
database chap 1 and 2.pptxEliasasefa
 
Implementation issues software engineering
Implementation issues software engineeringImplementation issues software engineering
Implementation issues software engineeringrishi ram khanal
 
information system lecture notes
information system lecture notesinformation system lecture notes
information system lecture notesnaeem_mnm
 
Chapter01 introduction
Chapter01 introductionChapter01 introduction
Chapter01 introductionNgeam Soly
 
dataflowdiagram2 121005140736-phpapp01
dataflowdiagram2 121005140736-phpapp01dataflowdiagram2 121005140736-phpapp01
dataflowdiagram2 121005140736-phpapp01Shashi soni
 
Data oriented and Process oriented Strategies for Legacy Information Systems ...
Data oriented and Process oriented Strategies for Legacy Information Systems ...Data oriented and Process oriented Strategies for Legacy Information Systems ...
Data oriented and Process oriented Strategies for Legacy Information Systems ...IDES Editor
 
Pertemuan 4-analysis-modelling
Pertemuan 4-analysis-modellingPertemuan 4-analysis-modelling
Pertemuan 4-analysis-modellingMeerat Malik
 
Introduction To DBMS
Introduction To DBMSIntroduction To DBMS
Introduction To DBMSrafat_mentor
 
System analysis and design logical design
System analysis and design  logical designSystem analysis and design  logical design
System analysis and design logical designGirdharRatne
 

What's hot (16)

Data models
Data modelsData models
Data models
 
Design1
Design1Design1
Design1
 
System analysis and design Class 2
System analysis and design Class 2System analysis and design Class 2
System analysis and design Class 2
 
IT class IV - ICAB PS-KL
IT class IV - ICAB PS-KLIT class IV - ICAB PS-KL
IT class IV - ICAB PS-KL
 
Dbms interview questions s.pdf
Dbms interview questions s.pdfDbms interview questions s.pdf
Dbms interview questions s.pdf
 
ans3ed-oddonly.pdf
ans3ed-oddonly.pdfans3ed-oddonly.pdf
ans3ed-oddonly.pdf
 
database chap 1 and 2.pptx
database chap 1 and 2.pptxdatabase chap 1 and 2.pptx
database chap 1 and 2.pptx
 
Implementation issues software engineering
Implementation issues software engineeringImplementation issues software engineering
Implementation issues software engineering
 
information system lecture notes
information system lecture notesinformation system lecture notes
information system lecture notes
 
Chapter01 introduction
Chapter01 introductionChapter01 introduction
Chapter01 introduction
 
dataflowdiagram2 121005140736-phpapp01
dataflowdiagram2 121005140736-phpapp01dataflowdiagram2 121005140736-phpapp01
dataflowdiagram2 121005140736-phpapp01
 
E workshop system design
E workshop system designE workshop system design
E workshop system design
 
Data oriented and Process oriented Strategies for Legacy Information Systems ...
Data oriented and Process oriented Strategies for Legacy Information Systems ...Data oriented and Process oriented Strategies for Legacy Information Systems ...
Data oriented and Process oriented Strategies for Legacy Information Systems ...
 
Pertemuan 4-analysis-modelling
Pertemuan 4-analysis-modellingPertemuan 4-analysis-modelling
Pertemuan 4-analysis-modelling
 
Introduction To DBMS
Introduction To DBMSIntroduction To DBMS
Introduction To DBMS
 
System analysis and design logical design
System analysis and design  logical designSystem analysis and design  logical design
System analysis and design logical design
 

Viewers also liked

Viewers also liked (6)

Relation base model
Relation base modelRelation base model
Relation base model
 
Visual Basic 6 Data Base
Visual Basic 6 Data BaseVisual Basic 6 Data Base
Visual Basic 6 Data Base
 
Data base management system
Data base management systemData base management system
Data base management system
 
Basic DBMS ppt
Basic DBMS pptBasic DBMS ppt
Basic DBMS ppt
 
Types of databases
Types of databasesTypes of databases
Types of databases
 
Dbms slides
Dbms slidesDbms slides
Dbms slides
 

Similar to Rdbms xp 02

What is the difference between Data and Information give an exa
What is the difference between Data and Information give an exaWhat is the difference between Data and Information give an exa
What is the difference between Data and Information give an exavictorring
 
Chapter – 3 Database Design P-I.pdf
Chapter – 3 Database Design P-I.pdfChapter – 3 Database Design P-I.pdf
Chapter – 3 Database Design P-I.pdfTamiratDejene1
 
Advanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docxAdvanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docxnettletondevon
 
Database concepts and Archeticture Ch2 with in class Activities
Database concepts and Archeticture Ch2 with in class ActivitiesDatabase concepts and Archeticture Ch2 with in class Activities
Database concepts and Archeticture Ch2 with in class ActivitiesZainab Almugbel
 
Dbms Notes Lecture 2 : Levels of Data Abstraction
Dbms Notes Lecture 2 : Levels of Data AbstractionDbms Notes Lecture 2 : Levels of Data Abstraction
Dbms Notes Lecture 2 : Levels of Data AbstractionBIT Durg
 
DATA BASE MANAGEMENT SYSTEM - SHORT NOTES
DATA BASE MANAGEMENT SYSTEM - SHORT NOTESDATA BASE MANAGEMENT SYSTEM - SHORT NOTES
DATA BASE MANAGEMENT SYSTEM - SHORT NOTESsuthi
 
Vb net xp_05
Vb net xp_05Vb net xp_05
Vb net xp_05Niit Care
 
ICT DBA3 03 0710 Designing a Database.pptx
ICT DBA3 03 0710 Designing a Database.pptxICT DBA3 03 0710 Designing a Database.pptx
ICT DBA3 03 0710 Designing a Database.pptxInfotech27
 
E-R model unit(Iv)
E-R model unit(Iv)E-R model unit(Iv)
E-R model unit(Iv)PadmapriyaA6
 
DBMS interview questions
DBMS interview questionsDBMS interview questions
DBMS interview questionsHarish Gyanani
 
Chapter 7 Design Architecture and Methodology1.docx
Chapter 7 Design Architecture and Methodology1.docxChapter 7 Design Architecture and Methodology1.docx
Chapter 7 Design Architecture and Methodology1.docxmccormicknadine86
 
Database System Concepts and Architecture
Database System Concepts and ArchitectureDatabase System Concepts and Architecture
Database System Concepts and Architecturesontumax
 

Similar to Rdbms xp 02 (20)

What is the difference between Data and Information give an exa
What is the difference between Data and Information give an exaWhat is the difference between Data and Information give an exa
What is the difference between Data and Information give an exa
 
Chapter – 3 Database Design P-I.pdf
Chapter – 3 Database Design P-I.pdfChapter – 3 Database Design P-I.pdf
Chapter – 3 Database Design P-I.pdf
 
Nagaraju
NagarajuNagaraju
Nagaraju
 
Advanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docxAdvanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docx
 
Ch2 another design
Ch2 another designCh2 another design
Ch2 another design
 
Database concepts and Archeticture Ch2 with in class Activities
Database concepts and Archeticture Ch2 with in class ActivitiesDatabase concepts and Archeticture Ch2 with in class Activities
Database concepts and Archeticture Ch2 with in class Activities
 
Dbms Notes Lecture 2 : Levels of Data Abstraction
Dbms Notes Lecture 2 : Levels of Data AbstractionDbms Notes Lecture 2 : Levels of Data Abstraction
Dbms Notes Lecture 2 : Levels of Data Abstraction
 
Unit 1.2.pptx
Unit 1.2.pptxUnit 1.2.pptx
Unit 1.2.pptx
 
Dbms basics 02
Dbms basics 02Dbms basics 02
Dbms basics 02
 
Ch09
Ch09Ch09
Ch09
 
DATA BASE MANAGEMENT SYSTEM - SHORT NOTES
DATA BASE MANAGEMENT SYSTEM - SHORT NOTESDATA BASE MANAGEMENT SYSTEM - SHORT NOTES
DATA BASE MANAGEMENT SYSTEM - SHORT NOTES
 
Vb net xp_05
Vb net xp_05Vb net xp_05
Vb net xp_05
 
21792 relational database managementsystem
21792 relational database managementsystem21792 relational database managementsystem
21792 relational database managementsystem
 
ICT DBA3 03 0710 Designing a Database.pptx
ICT DBA3 03 0710 Designing a Database.pptxICT DBA3 03 0710 Designing a Database.pptx
ICT DBA3 03 0710 Designing a Database.pptx
 
E-R model unit(Iv)
E-R model unit(Iv)E-R model unit(Iv)
E-R model unit(Iv)
 
Relational database design
Relational database designRelational database design
Relational database design
 
DBMS interview questions
DBMS interview questionsDBMS interview questions
DBMS interview questions
 
RDBMS_Concept.ppt
RDBMS_Concept.pptRDBMS_Concept.ppt
RDBMS_Concept.ppt
 
Chapter 7 Design Architecture and Methodology1.docx
Chapter 7 Design Architecture and Methodology1.docxChapter 7 Design Architecture and Methodology1.docx
Chapter 7 Design Architecture and Methodology1.docx
 
Database System Concepts and Architecture
Database System Concepts and ArchitectureDatabase System Concepts and Architecture
Database System Concepts and Architecture
 

More from Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

Rdbms xp 02

  • 1. Database Design Objectives In this lesson, you will learn to: Map an entity-relationship diagram to tables in relation to the following: Regular entities Attributes Relationships Weak entities Subtypes and supertypes ©NIIT RDBMS/Lesson 2/Slide 1 of 19
  • 2. Database Design Conceptual Model Reflects entities and their relationships, based on the data processing needs of an organization Can be mapped to a relational, hierarchical, or network model Is independent of individual applications, database management systems, hardware, and physical storage of data ©NIIT RDBMS/Lesson 2/Slide 2 of 19
  • 3. Database Design Mapping Entity-Relationship Diagrams to Tables A database that conforms to an E/R diagram can be represented by a collection of tables in the relational system The mapping of E/R diagrams to tables can be discussed in relation to the following: Regular entities Attributes Relationships Weak entities Subtypes and Supertypes ©NIIT RDBMS/Lesson 2/Slide 3 of 19
  • 4. Database Design Regular Entities They can exist in isolation, independent of any other entity They are the “building blocks” of the database Each regular entity maps to a table ©NIIT RDBMS/Lesson 2/Slide 4 of 19
  • 5. Database Design Attributes Each property or attribute shown in the E/R diagram maps to a column in the appropriate table ©NIIT RDBMS/Lesson 2/Slide 5 of 19
  • 6. Database Design Relationships Each type of relationship maps to tables in a different manner in the relational database management system The most important principle is to create tables where information from the real world is stored and retrieved in an optimal way; that is, a minimum number of tables with a minimum number of attributes In a relational system, a join operation retrieves all information by combining two or more tables ©NIIT RDBMS/Lesson 2/Slide 6 of 19
  • 7. Database Design Relationships (Contd.) Are of the following types: One-to-One One-to-Many Many-to-Many ©NIIT RDBMS/Lesson 2/Slide 7 of 19
  • 8. Database Design Weak Entities A weak entity is an entity whose existence depends on some other entity It cannot exist if the entity on which it depends does not exist ©NIIT RDBMS/Lesson 2/Slide 8 of 19
  • 9. Database Design Subtypes and Supertypes Each entity type (subtypes and supertypes) maps to a separate table The primary key of the supertype is the foreign key of the subtype It creates a link between the two The foreign key of the subtype is also its primary key ©NIIT RDBMS/Lesson 2/Slide 9 of 19
  • 10. Database Design Tips on Logical Database Design Attributes: Do not introduce any unnecessary attributes An attribute serves three purposes: ® To identify its owner entity ® To refer to another entity ® To simplify the description of an entity ©NIIT RDBMS/Lesson 2/Slide 10 of 19
  • 11. Database Design Tips on Logical Database Design (Contd.) Keys: Relational systems require keys that uniquely identify the rows of a table. There are various types of keys: ® Primary ® Foreign ® Candidate ® Alternate ® Composite ©NIIT RDBMS/Lesson 2/Slide 11 of 19
  • 12. Database Design Tips on Logical Database Design (Contd.) Any attribute (or set of attributes) that uniquely identifies a row in a table is a candidate for the primary key. Such an attribute is called a candidate key. Any attribute that is a candidate for the primary key but is not the primary key is called the alternate key. Keys can be simple or composite ®A simple key is composed of a single attribute ®Acomposite key, on the other hand, comprises two or more attributes ©NIIT RDBMS/Lesson 2/Slide 12 of 19
  • 13. Database Design Just a Minute… Define the following terms: a. Candidate Key b. Alternate Key   ©NIIT RDBMS/Lesson 2/Slide 13 of 19
  • 14. Database Design Tips on Logical Database Design (Contd.) Entities: Some attributes may acquire further attributes during database design and become entities. Subentities: Replace optional attributes of an entity with subentities. This is called specialization. Specialization is the result of taking a subset of a higher- level entity set to form a lower-level entity set Generalization is the result of taking the union of two or more lower-level entity sets to produce a higher‑level entity set. ©NIIT RDBMS/Lesson 2/Slide 14 of 19
  • 15. Database Design Problem Statement 2.P.1 Map the E/R diagram to its corresponding tables ©NIIT RDBMS/Lesson 2/Slide 15 of 19
  • 16. Database Design Summary In this lesson, you learned that: The conceptual model reflects entities and their relationships. Data analysis helps determine entities and relationships. The conceptual model is independent of the system where it is to be implemented. Regular entities are not dependent. They can exist in isolation, independent of any other entity. Each entity maps to a table. Each attribute in an E/R diagram maps to an attribute in a table. Entities with common attributes should be merged. Attributes may acquire further attributes and become entities. ©NIIT RDBMS/Lesson 2/Slide 16 of 19
  • 17. Database Design Summary (Contd.) The mapping of relationships depends on the type of relationship. Each type of relationship maps to tables in a different manner in the relational database management system. In one-to-one relationships, one instance of an entity can relate to only one instance of the related entity. In a one-to-many relationship, one instance of an entity can relate to more than one instance of the related entity. Many-to-many relationships map to tables. One-to-one relationships are not very common and may map to foreign keys in tables. ©NIIT RDBMS/Lesson 2/Slide 17 of 19
  • 18. Database Design Summary (Contd.) A weak entity is an entity whose existence depends on some other entity. A subtype is a subset of another entity. A subtype is always dependent on supertype for its existence. The primary key of the supertype is the foreign key of the subtype. It creates a link between the two. A candidate key is a candidate for the primary key. An alternate key is a candidate key that is not a primary key. Optional attributes should be replaced with subentities; this is also called specialization. ©NIIT RDBMS/Lesson 2/Slide 18 of 19
  • 19. Database Design Summary (Contd.) To simplify multiple references, a new superentity should be introduced; this is also called generalization. ©NIIT RDBMS/Lesson 2/Slide 19 of 19