SlideShare a Scribd company logo
Database Systems
(SWEG2108)
Chapter –3 Database Design
Chapter 3 Outline
• Relational Integrity Rules
• Conceptual DB Design: ER Diagrams - Revision
• Next lesson: Mapping ERD to Relational Model
2
Relational Constraints/Integrity Rules
The different Relational Integrity Rules
• Domain Integrity
• No value of the attribute should be beyond the allowable limits
• Entity Integrity
• In a base relation, no attribute of a Primary Key can assume a value of NULL
• Referential Integrity
• If a Foreign Key exists in a relation, either the Foreign Key value
must match a Candidate Key value in its home relation or the Foreign Key value must be NULL
• Enterprise Integrity
• Additional rules specified by the users or database administrators of
a database are incorporated Database Design 5
Relational Constraints/Integrity Rules - Example
Table 1: Student Table 2: Student
Table 3: Employee
Key constraints
• Super Key:
• Set of attribute or attributes that uniquely identifies a tuple within a relation.
• A key which we just understand or think at the beginning and they can even be
every key in a table
• Candidate Key:
• It is minimal subset of super key
• If any proper subset of a super key is super key then that key cannot be
a candidate key.
• Primary keys:
• The candidate key chosen to uniquely identify each row of data in a table
• The DBA Picks any one of the candidate key to be the primary key
• The rest one of the candidate key become alternate keys
• Foreign key:
• Primary key of another table used to define relationship with another table and
is used to maintain integrity
Database Design 7
What is composite key?
Key constraint Example
• Possible combination of Super keys
• The following key are combinations of candidate keys
• REG_ID is the primary key
• SID and EMAIL become alternate keys Database Design 8
Student Table
Relational Views
There are two kinds of relation in relational database.
1. Base Relation(Named Relation)
– corresponding to an entity in the conceptual schema, whose tuples
are physically stored in the database.
2. View (Unnamed Relation)
– A View is the dynamic result of one or more relational operations
operating on the base relations to produce another virtual relation
that does not actually exist as presented.
– View is a virtually derived relation that does not necessarily exist in
the database but can be produced upon request by a particular user
at the time of request.
Database Design 9
Purpose of a view
Hides unnecessary information from users:
– since only part of the base relation (Some collection of
attributes, not necessarily all) are to be included in the
virtual table.
Provide powerful flexibility and security:
– since unnecessary information will be hidden from the
user there will be some sort of data security.
Provide customized view of the database for users:
– each user is going to be interfaced with his own
preferred data set and format by making use of the
Views.
Database Design 10
Purpose of a view
• Update on views derived from various relations is not
allowed since it may violate the integrity of the database.
• Since aggregation and summary results are computed
from a base relation and does not exist actually.
– Update on view with aggregation and summary is not
allowed.
Database Design 11
Schemas and Instances
• When a database is designed using a
Relational data model
– all the data is represented in a form of a table.
• In such definitions and representation
– there are two basic components of the database.
» Schemas
» Instances
Database Design 12
Schemas and Instances
Database Schema:
– specifies name of relation and the collection of the attributes
(specifically the Name of attributes).
– refer to a description of database or describes how data is to be
structured
– specified during database design
– should not be changed unless during maintenance
Schema Diagrams
– convention to display some aspect of a schema visually
Schema Construct
– refers to each object in the schema (e.g. STUDENT)
• E.g.: STUDENT (FName, LName, Id, Year, Dept, Sex)
Database Design 13
Schemas and Instances
Instances
– is the collection of data in the database at a particular point of time
(snap-shot).
– Also called State or Snap Shot or Extension of the database
– Refers to the actual data in the database at a specific point in time
– State of database is changed any time we add, delete or update an
item.
– Since Instance is actual data of database at some point in time,
changes rapidly
• To define a new database, we specify its database schema to
the DBMS (database is empty)
• database is initialized when we first load it with data
Database Design 14
Database design: has 3 levels
Database Design 16
Database design: Conceptual Design
Database Design 17
Entity Relationship Diagram (ERD)
Database Design 18
ERD…
Database Design 19
ERD Example
Database Design 20
ERD… Cardinality Constraints: 1:1, 1:m, N:M
Database Design 21
Note : Keep in mind that connecting links like those enclosed with stars will have different meaning.
Database Design 22
ERD… Cardinality Constraints: 1:1, 1:m, N:M
ERD … Participation constraints
Database Design 23
Class Exercise: ER Diagram
A simplified requirements of tiny college are as follows:
• A college contains many departments.
• Each department can offer any number of courses.
• Many instructors can work in a departments.
• An instructor can work only in one department.
• For each department there is a head.
• An instructor can be head of only one department.
• Each instructor can offer any number of courses.
• A course can be offered by only one instructor.
• A student can enroll for any number of courses.
• Each course can be enrolled any number of students.
• Construct ER diagram and describe any assumption you take.
• Show the min. and max. cardinalities.
• State the degree of relation ship between entities.
Answer : ER Diagram
Note : Keep in mind that connecting links like those enclosed with star are wrongly connected.
Home Work : ER Diagram
Answer: ER Diagram
Thank
you!

More Related Content

Similar to Chapter – 3 Database Design P-I.pdf

Entity relationship (er) modeling
Entity relationship (er) modelingEntity relationship (er) modeling
Entity relationship (er) modeling
Dhani Ahmad
 
Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdf
TamiratDejene1
 
02010 ppt ch04
02010 ppt ch0402010 ppt ch04
02010 ppt ch04
ams1ams1
 
DBMS ppts unit1.pptx
DBMS ppts  unit1.pptxDBMS ppts  unit1.pptx
DBMS ppts unit1.pptx
VaibhavSaluja1
 
Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04
Jotham Gadot
 
Module 1 - Chapter 2.pptx
Module 1 - Chapter 2.pptxModule 1 - Chapter 2.pptx
Module 1 - Chapter 2.pptx
SoniaDevi15
 
02010 ppt ch02
02010 ppt ch0202010 ppt ch02
02010 ppt ch02
Hpong Js
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptx
AshmitKashyap1
 
Database system concepts
Database system conceptsDatabase system concepts
Database system concepts
Dr. Jasmine Beulah Gnanadurai
 
Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptx
NurulIzrin
 
Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03
Jotham Gadot
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
NILESH UCHCHASARE
 
Database intro
Database introDatabase intro
Database intro
varsha nihanth lade
 
DBMS unit 1.pptx
DBMS unit 1.pptxDBMS unit 1.pptx
DBMS unit 1.pptx
ssuserc8e1481
 
demo2.ppt
demo2.pptdemo2.ppt
demo2.ppt
crazyvirtue
 
Sachin noire 2024
Sachin noire 2024Sachin noire 2024
Sachin noire 2024
sachin kumar
 
Data Models - Department of Computer Science & Engineering
Data Models - Department of Computer Science & EngineeringData Models - Department of Computer Science & Engineering
Data Models - Department of Computer Science & Engineering
acemindia
 
Relational model
Relational modelRelational model
Relational model
WBUTTUTORIALS
 
Ch1_Intro-95(1).ppt
Ch1_Intro-95(1).pptCh1_Intro-95(1).ppt
Ch1_Intro-95(1).ppt
RAJULKUMARSUTHAR
 
DBMS & Data Models - In Introduction
DBMS & Data Models - In IntroductionDBMS & Data Models - In Introduction
DBMS & Data Models - In Introduction
Rajeev Srivastava
 

Similar to Chapter – 3 Database Design P-I.pdf (20)

Entity relationship (er) modeling
Entity relationship (er) modelingEntity relationship (er) modeling
Entity relationship (er) modeling
 
Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdf
 
02010 ppt ch04
02010 ppt ch0402010 ppt ch04
02010 ppt ch04
 
DBMS ppts unit1.pptx
DBMS ppts  unit1.pptxDBMS ppts  unit1.pptx
DBMS ppts unit1.pptx
 
Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04
 
Module 1 - Chapter 2.pptx
Module 1 - Chapter 2.pptxModule 1 - Chapter 2.pptx
Module 1 - Chapter 2.pptx
 
02010 ppt ch02
02010 ppt ch0202010 ppt ch02
02010 ppt ch02
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptx
 
Database system concepts
Database system conceptsDatabase system concepts
Database system concepts
 
Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptx
 
Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Database intro
Database introDatabase intro
Database intro
 
DBMS unit 1.pptx
DBMS unit 1.pptxDBMS unit 1.pptx
DBMS unit 1.pptx
 
demo2.ppt
demo2.pptdemo2.ppt
demo2.ppt
 
Sachin noire 2024
Sachin noire 2024Sachin noire 2024
Sachin noire 2024
 
Data Models - Department of Computer Science & Engineering
Data Models - Department of Computer Science & EngineeringData Models - Department of Computer Science & Engineering
Data Models - Department of Computer Science & Engineering
 
Relational model
Relational modelRelational model
Relational model
 
Ch1_Intro-95(1).ppt
Ch1_Intro-95(1).pptCh1_Intro-95(1).ppt
Ch1_Intro-95(1).ppt
 
DBMS & Data Models - In Introduction
DBMS & Data Models - In IntroductionDBMS & Data Models - In Introduction
DBMS & Data Models - In Introduction
 

More from TamiratDejene1

Ch-3 lecture.pdf
Ch-3 lecture.pdfCh-3 lecture.pdf
Ch-3 lecture.pdf
TamiratDejene1
 
Chapter 2.pptx
Chapter 2.pptxChapter 2.pptx
Chapter 2.pptx
TamiratDejene1
 
Wireless LANs.ppt
Wireless LANs.pptWireless LANs.ppt
Wireless LANs.ppt
TamiratDejene1
 
Data Link Control.ppt
Data Link Control.pptData Link Control.ppt
Data Link Control.ppt
TamiratDejene1
 
Congestion Control and QOS.ppt
Congestion Control and QOS.pptCongestion Control and QOS.ppt
Congestion Control and QOS.ppt
TamiratDejene1
 
Analog Transmission.ppt
Analog Transmission.pptAnalog Transmission.ppt
Analog Transmission.ppt
TamiratDejene1
 
Chapter 5 (Part I) - Pointers.pdf
Chapter 5 (Part I) - Pointers.pdfChapter 5 (Part I) - Pointers.pdf
Chapter 5 (Part I) - Pointers.pdf
TamiratDejene1
 
Chapter 7 (Part I) - User Defined Datatypes.pdf
Chapter 7 (Part I) - User Defined Datatypes.pdfChapter 7 (Part I) - User Defined Datatypes.pdf
Chapter 7 (Part I) - User Defined Datatypes.pdf
TamiratDejene1
 
00-intro-to-classes.pdf
00-intro-to-classes.pdf00-intro-to-classes.pdf
00-intro-to-classes.pdf
TamiratDejene1
 
DLD Chapter-5.pdf
DLD Chapter-5.pdfDLD Chapter-5.pdf
DLD Chapter-5.pdf
TamiratDejene1
 
DLD Chapter-4.pdf
DLD Chapter-4.pdfDLD Chapter-4.pdf
DLD Chapter-4.pdf
TamiratDejene1
 
DLD Chapter-2.pdf
DLD Chapter-2.pdfDLD Chapter-2.pdf
DLD Chapter-2.pdf
TamiratDejene1
 
DLD Chapter-1.pdf
DLD Chapter-1.pdfDLD Chapter-1.pdf
DLD Chapter-1.pdf
TamiratDejene1
 
DLD_Chapter_1.pdf
DLD_Chapter_1.pdfDLD_Chapter_1.pdf
DLD_Chapter_1.pdf
TamiratDejene1
 
Chapter 8_Shift Registers (EEEg4302)1.pdf
Chapter 8_Shift Registers (EEEg4302)1.pdfChapter 8_Shift Registers (EEEg4302)1.pdf
Chapter 8_Shift Registers (EEEg4302)1.pdf
TamiratDejene1
 
Chapter 7_Counters (EEEg4302).pdf
Chapter 7_Counters (EEEg4302).pdfChapter 7_Counters (EEEg4302).pdf
Chapter 7_Counters (EEEg4302).pdf
TamiratDejene1
 
Chapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdfChapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdf
TamiratDejene1
 
Chapter 3_Logic Gates (EEEg4302).pdf
Chapter 3_Logic Gates (EEEg4302).pdfChapter 3_Logic Gates (EEEg4302).pdf
Chapter 3_Logic Gates (EEEg4302).pdf
TamiratDejene1
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
TamiratDejene1
 
Chapter 1_Introduction to digital design (EEEg4302).pdf
Chapter 1_Introduction to digital design (EEEg4302).pdfChapter 1_Introduction to digital design (EEEg4302).pdf
Chapter 1_Introduction to digital design (EEEg4302).pdf
TamiratDejene1
 

More from TamiratDejene1 (20)

Ch-3 lecture.pdf
Ch-3 lecture.pdfCh-3 lecture.pdf
Ch-3 lecture.pdf
 
Chapter 2.pptx
Chapter 2.pptxChapter 2.pptx
Chapter 2.pptx
 
Wireless LANs.ppt
Wireless LANs.pptWireless LANs.ppt
Wireless LANs.ppt
 
Data Link Control.ppt
Data Link Control.pptData Link Control.ppt
Data Link Control.ppt
 
Congestion Control and QOS.ppt
Congestion Control and QOS.pptCongestion Control and QOS.ppt
Congestion Control and QOS.ppt
 
Analog Transmission.ppt
Analog Transmission.pptAnalog Transmission.ppt
Analog Transmission.ppt
 
Chapter 5 (Part I) - Pointers.pdf
Chapter 5 (Part I) - Pointers.pdfChapter 5 (Part I) - Pointers.pdf
Chapter 5 (Part I) - Pointers.pdf
 
Chapter 7 (Part I) - User Defined Datatypes.pdf
Chapter 7 (Part I) - User Defined Datatypes.pdfChapter 7 (Part I) - User Defined Datatypes.pdf
Chapter 7 (Part I) - User Defined Datatypes.pdf
 
00-intro-to-classes.pdf
00-intro-to-classes.pdf00-intro-to-classes.pdf
00-intro-to-classes.pdf
 
DLD Chapter-5.pdf
DLD Chapter-5.pdfDLD Chapter-5.pdf
DLD Chapter-5.pdf
 
DLD Chapter-4.pdf
DLD Chapter-4.pdfDLD Chapter-4.pdf
DLD Chapter-4.pdf
 
DLD Chapter-2.pdf
DLD Chapter-2.pdfDLD Chapter-2.pdf
DLD Chapter-2.pdf
 
DLD Chapter-1.pdf
DLD Chapter-1.pdfDLD Chapter-1.pdf
DLD Chapter-1.pdf
 
DLD_Chapter_1.pdf
DLD_Chapter_1.pdfDLD_Chapter_1.pdf
DLD_Chapter_1.pdf
 
Chapter 8_Shift Registers (EEEg4302)1.pdf
Chapter 8_Shift Registers (EEEg4302)1.pdfChapter 8_Shift Registers (EEEg4302)1.pdf
Chapter 8_Shift Registers (EEEg4302)1.pdf
 
Chapter 7_Counters (EEEg4302).pdf
Chapter 7_Counters (EEEg4302).pdfChapter 7_Counters (EEEg4302).pdf
Chapter 7_Counters (EEEg4302).pdf
 
Chapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdfChapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdf
 
Chapter 3_Logic Gates (EEEg4302).pdf
Chapter 3_Logic Gates (EEEg4302).pdfChapter 3_Logic Gates (EEEg4302).pdf
Chapter 3_Logic Gates (EEEg4302).pdf
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
 
Chapter 1_Introduction to digital design (EEEg4302).pdf
Chapter 1_Introduction to digital design (EEEg4302).pdfChapter 1_Introduction to digital design (EEEg4302).pdf
Chapter 1_Introduction to digital design (EEEg4302).pdf
 

Recently uploaded

Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCAModule 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
yuvarajkumar334
 
reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdfreading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
perranet1
 
一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理
zsafxbf
 
一比一原版南昆士兰大学毕业证如何办理
一比一原版南昆士兰大学毕业证如何办理一比一原版南昆士兰大学毕业证如何办理
一比一原版南昆士兰大学毕业证如何办理
ugydym
 
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
osoyvvf
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics May 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics May 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics May 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics May 2024
Vietnam Cotton & Spinning Association
 
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdfOverview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
nhutnguyen355078
 
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
eudsoh
 
一比一原版悉尼大学毕业证如何办理
一比一原版悉尼大学毕业证如何办理一比一原版悉尼大学毕业证如何办理
一比一原版悉尼大学毕业证如何办理
keesa2
 
Sample Devops SRE Product Companies .pdf
Sample Devops SRE  Product Companies .pdfSample Devops SRE  Product Companies .pdf
Sample Devops SRE Product Companies .pdf
Vineet
 
Senior Engineering Sample EM DOE - Sheet1.pdf
Senior Engineering Sample EM DOE  - Sheet1.pdfSenior Engineering Sample EM DOE  - Sheet1.pdf
Senior Engineering Sample EM DOE - Sheet1.pdf
Vineet
 
SAP BW4HANA Implementagtion Content Document
SAP BW4HANA Implementagtion Content DocumentSAP BW4HANA Implementagtion Content Document
SAP BW4HANA Implementagtion Content Document
newdirectionconsulta
 
Data Scientist Machine Learning Profiles .pdf
Data Scientist Machine Learning  Profiles .pdfData Scientist Machine Learning  Profiles .pdf
Data Scientist Machine Learning Profiles .pdf
Vineet
 
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
Rebecca Bilbro
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
uevausa
 
Template xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptxTemplate xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptx
TeukuEriSyahputra
 
Sid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.pptSid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.ppt
ArshadAyub49
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 
A gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented GenerationA gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented Generation
dataschool1
 
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
nyvan3
 

Recently uploaded (20)

Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCAModule 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
 
reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdfreading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
 
一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理
 
一比一原版南昆士兰大学毕业证如何办理
一比一原版南昆士兰大学毕业证如何办理一比一原版南昆士兰大学毕业证如何办理
一比一原版南昆士兰大学毕业证如何办理
 
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics May 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics May 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics May 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics May 2024
 
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdfOverview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
 
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
 
一比一原版悉尼大学毕业证如何办理
一比一原版悉尼大学毕业证如何办理一比一原版悉尼大学毕业证如何办理
一比一原版悉尼大学毕业证如何办理
 
Sample Devops SRE Product Companies .pdf
Sample Devops SRE  Product Companies .pdfSample Devops SRE  Product Companies .pdf
Sample Devops SRE Product Companies .pdf
 
Senior Engineering Sample EM DOE - Sheet1.pdf
Senior Engineering Sample EM DOE  - Sheet1.pdfSenior Engineering Sample EM DOE  - Sheet1.pdf
Senior Engineering Sample EM DOE - Sheet1.pdf
 
SAP BW4HANA Implementagtion Content Document
SAP BW4HANA Implementagtion Content DocumentSAP BW4HANA Implementagtion Content Document
SAP BW4HANA Implementagtion Content Document
 
Data Scientist Machine Learning Profiles .pdf
Data Scientist Machine Learning  Profiles .pdfData Scientist Machine Learning  Profiles .pdf
Data Scientist Machine Learning Profiles .pdf
 
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
 
Template xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptxTemplate xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptx
 
Sid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.pptSid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.ppt
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 
A gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented GenerationA gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented Generation
 
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
 

Chapter – 3 Database Design P-I.pdf

  • 2. Chapter 3 Outline • Relational Integrity Rules • Conceptual DB Design: ER Diagrams - Revision • Next lesson: Mapping ERD to Relational Model 2
  • 3. Relational Constraints/Integrity Rules The different Relational Integrity Rules • Domain Integrity • No value of the attribute should be beyond the allowable limits • Entity Integrity • In a base relation, no attribute of a Primary Key can assume a value of NULL • Referential Integrity • If a Foreign Key exists in a relation, either the Foreign Key value must match a Candidate Key value in its home relation or the Foreign Key value must be NULL • Enterprise Integrity • Additional rules specified by the users or database administrators of a database are incorporated Database Design 5
  • 4. Relational Constraints/Integrity Rules - Example Table 1: Student Table 2: Student Table 3: Employee
  • 5. Key constraints • Super Key: • Set of attribute or attributes that uniquely identifies a tuple within a relation. • A key which we just understand or think at the beginning and they can even be every key in a table • Candidate Key: • It is minimal subset of super key • If any proper subset of a super key is super key then that key cannot be a candidate key. • Primary keys: • The candidate key chosen to uniquely identify each row of data in a table • The DBA Picks any one of the candidate key to be the primary key • The rest one of the candidate key become alternate keys • Foreign key: • Primary key of another table used to define relationship with another table and is used to maintain integrity Database Design 7 What is composite key?
  • 6. Key constraint Example • Possible combination of Super keys • The following key are combinations of candidate keys • REG_ID is the primary key • SID and EMAIL become alternate keys Database Design 8 Student Table
  • 7. Relational Views There are two kinds of relation in relational database. 1. Base Relation(Named Relation) – corresponding to an entity in the conceptual schema, whose tuples are physically stored in the database. 2. View (Unnamed Relation) – A View is the dynamic result of one or more relational operations operating on the base relations to produce another virtual relation that does not actually exist as presented. – View is a virtually derived relation that does not necessarily exist in the database but can be produced upon request by a particular user at the time of request. Database Design 9
  • 8. Purpose of a view Hides unnecessary information from users: – since only part of the base relation (Some collection of attributes, not necessarily all) are to be included in the virtual table. Provide powerful flexibility and security: – since unnecessary information will be hidden from the user there will be some sort of data security. Provide customized view of the database for users: – each user is going to be interfaced with his own preferred data set and format by making use of the Views. Database Design 10
  • 9. Purpose of a view • Update on views derived from various relations is not allowed since it may violate the integrity of the database. • Since aggregation and summary results are computed from a base relation and does not exist actually. – Update on view with aggregation and summary is not allowed. Database Design 11
  • 10. Schemas and Instances • When a database is designed using a Relational data model – all the data is represented in a form of a table. • In such definitions and representation – there are two basic components of the database. » Schemas » Instances Database Design 12
  • 11. Schemas and Instances Database Schema: – specifies name of relation and the collection of the attributes (specifically the Name of attributes). – refer to a description of database or describes how data is to be structured – specified during database design – should not be changed unless during maintenance Schema Diagrams – convention to display some aspect of a schema visually Schema Construct – refers to each object in the schema (e.g. STUDENT) • E.g.: STUDENT (FName, LName, Id, Year, Dept, Sex) Database Design 13
  • 12. Schemas and Instances Instances – is the collection of data in the database at a particular point of time (snap-shot). – Also called State or Snap Shot or Extension of the database – Refers to the actual data in the database at a specific point in time – State of database is changed any time we add, delete or update an item. – Since Instance is actual data of database at some point in time, changes rapidly • To define a new database, we specify its database schema to the DBMS (database is empty) • database is initialized when we first load it with data Database Design 14
  • 13. Database design: has 3 levels Database Design 16
  • 14. Database design: Conceptual Design Database Design 17
  • 15. Entity Relationship Diagram (ERD) Database Design 18
  • 18. ERD… Cardinality Constraints: 1:1, 1:m, N:M Database Design 21 Note : Keep in mind that connecting links like those enclosed with stars will have different meaning.
  • 19. Database Design 22 ERD… Cardinality Constraints: 1:1, 1:m, N:M
  • 20. ERD … Participation constraints Database Design 23
  • 21. Class Exercise: ER Diagram A simplified requirements of tiny college are as follows: • A college contains many departments. • Each department can offer any number of courses. • Many instructors can work in a departments. • An instructor can work only in one department. • For each department there is a head. • An instructor can be head of only one department. • Each instructor can offer any number of courses. • A course can be offered by only one instructor. • A student can enroll for any number of courses. • Each course can be enrolled any number of students. • Construct ER diagram and describe any assumption you take. • Show the min. and max. cardinalities. • State the degree of relation ship between entities.
  • 22. Answer : ER Diagram Note : Keep in mind that connecting links like those enclosed with star are wrongly connected.
  • 23. Home Work : ER Diagram