SlideShare a Scribd company logo
1 of 18
Database Management System
http://alltypeim.blogspot.in/
E-R SYMOLS:-
http://alltypeim.blogspot.in/
Review - Concepts
Relational Model is made up of tables
• A row of table = a relational instance/tuple.
• A column of table = an attribute
• A table = a schema/relation
• Cardinality = number of rows
• Degree = number of columns
http://alltypeim.blogspot.in/
From ER Model to Relational Model
So… how do we convert an ER diagram into a table??
Simple!!
Basic Ideas:
 Build a table for each entity set
 Build a table for each relationship set if necessary
 Make a column in the table for each attribute in the entity set.
 Primary Key
http://alltypeim.blogspot.in/
Keys
• Super Key
• Super Key is defined as a set of attributes within a table that
uniquely identifies each record within a table. Super Key is a
superset of Candidate key.
• Candidate Key
• Candidate keys are defined as the set of fields from which primary
key can be selected. It is an attribute or set of attribute that can act
as a primary key for a table to uniquely identify each record in that
table.
• Primary Key
• Primary key is a candidate key that is most appropriate to become
main key of the table. It is a key that uniquely identify each record
in a table.
•
http://alltypeim.blogspot.in/
Strong Entity Set
• An entity set that has a primary key is called
as Strong entity set.
• A member of a strong entity set is called
dominant entity .
• There is a single line connecting strong entity
set with the relation.
http://alltypeim.blogspot.in/
Example – Strong Entity Set
SID Name Major GPA
1234 John CS 2.8
5678 Mary EE 3.6
Student
SID Name
Major GPA
Advisor Professor
SSN Name
Dept
SSN Name Dept
9999 Smith Math
8888 Lee CS
http://alltypeim.blogspot.in/
Representation of Weak Entity Set
• Weak Entity Set Cannot exist alone.
• It does not have sufficient attributes to form a primary key of
its own.
• To build a table/schema for weak entity set :-
– Construct a table with one column for each attribute in the weak
entity set
– Remember to include discriminator
– Augment one extra column on the right side of the table, put in there
the primary key of the Strong Entity Set (the entity set that the weak
entity set is depending on)
– Primary Key of the weak entity set = Discriminator + foreign key
http://alltypeim.blogspot.in/
Example – Weak Entity Set
Age Name Parent_SID
10 Bart 1234
8 Lisa 5678
Student
SID Name
Major GPA
Name
Age
Childrenowns
* Primary key of Children is Parent_SID + Name
http://alltypeim.blogspot.in/
Representation of Relationship Set
 Unary/Binary Relationship set
 Depends on the cardinality and participation of the relationship
 Two possible approaches
 N-ary (multiple) Relationship set
 Primary Key Issue
 Identifying Relationship
 No relational model representation necessary
http://alltypeim.blogspot.in/
Example – One-to-One Relationship Set
SID Maj_ID Co S_Degree
9999 07 1234
8888 05 5678
Student
SID Name
Major GPA
ID Code
Majorstudy
* Primary key can be either SID or Maj_ID_Co
Degree
http://alltypeim.blogspot.in/
Example – One-to-One Relationship Set
SID Name Major GPA LP_S/N Hav_Cond
9999 Bart Economy -4.0 123-456 Own
8888 Lisa Physics 4.0 567-890 Loan
Student
SID Name
Major GPA
S/N #
LaptopHave
* Primary key can be either SID or LP_S/N
Condition
Brand
1:1 Relationship
http://alltypeim.blogspot.in/
Example – Many-to-One Relationship Set
SID Name Major GPA Pro_SSN Ad_Sem
9999 Bart Economy -4.0 123-456 Fall 2006
8888 Lisa Physics 4.0 567-890 Fall 2005
Student
SID Name
Major GPA
SSN
Professor
* Primary key of this table is SID
Semester
Name
N:1 Relationship
Dept
Advisor
http://alltypeim.blogspot.in/
Example – N-ary Relationship Set
P-Key1 P-Key2 P-Key3 A-Key D-Attribute
9999 8888 7777 6666 Yes
1234 5678 9012 3456 No
E-Set 1
P-Key1
Another Set
* Primary key of this table is P-Key1 + P-Key2 + P-Key3
D-Attribute
A relationship
A-Key
E-Set 2
P-Key2
E-Set 3
P-Key3
http://alltypeim.blogspot.in/
Representing Composite Attribute
• Relational Model Indivisibility Rule Applies
• One column for each component attribute
• NO column for the composite attribute itself
Professor
SSN Name
Address
SSN Name Street City
9999 Dr. Smith 50 1st St. Fake City
8888 Dr. Lee 1 B St. San Jose
Street City
http://alltypeim.blogspot.in/
Representing Multivalue Attribute
• For each multivalue attribute in an entity
set/relationship set
– Build a new relation schema with two columns
– One column for the primary keys of the entity
set/relationship set that has the multivalue attribute
– Another column for the multivalue attributes. Each cell of
this column holds only one value. So each value is
represented as an unique tuple
– Primary key for this schema is the union of all attributes
http://alltypeim.blogspot.in/
Example – Multivalue attribute
SID Name Major GPA
1234 John CS 2.8
5678 Homer EE 3.6
Student
SID Name
Major GPA
Stud_SID Children
1234 Johnson
1234 Mary
5678 Bart
5678 Lisa
5678 Maggie
Children
The primary key for this
table is Student_SID +
Children, the union of all
attributes
http://alltypeim.blogspot.in/
http://alltypeim.blogspot.in/

More Related Content

What's hot (13)

Presentation on Relational Schema (Database)
Presentation on Relational Schema (Database)Presentation on Relational Schema (Database)
Presentation on Relational Schema (Database)
 
Normalisation
NormalisationNormalisation
Normalisation
 
Typeorm decorators
Typeorm decoratorsTypeorm decorators
Typeorm decorators
 
Spreadsheet ml subject tables
Spreadsheet ml subject   tablesSpreadsheet ml subject   tables
Spreadsheet ml subject tables
 
Joins and unions
Joins and unionsJoins and unions
Joins and unions
 
oracle Sql constraint
oracle  Sql constraint oracle  Sql constraint
oracle Sql constraint
 
RDBMS Model
RDBMS ModelRDBMS Model
RDBMS Model
 
Ppt resource creation 1
Ppt resource creation 1Ppt resource creation 1
Ppt resource creation 1
 
Dbms 9: Relational Model
Dbms 9: Relational ModelDbms 9: Relational Model
Dbms 9: Relational Model
 
APA Web Documents 6th Ed.
APA Web Documents 6th Ed.APA Web Documents 6th Ed.
APA Web Documents 6th Ed.
 
Key
KeyKey
Key
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
Keys of database
Keys of databaseKeys of database
Keys of database
 

Similar to Database management system

Similar to Database management system (20)

E r model
E r modelE r model
E r model
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
 
Year 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st TermYear 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st Term
 
Data_base.pptx
Data_base.pptxData_base.pptx
Data_base.pptx
 
DBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.pptDBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.ppt
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- Fundamentals
 
Relational database management system
Relational database management systemRelational database management system
Relational database management system
 
Topics-Ch4Ch5.ppt
Topics-Ch4Ch5.pptTopics-Ch4Ch5.ppt
Topics-Ch4Ch5.ppt
 
Topics-Ch4Ch5.ppt
Topics-Ch4Ch5.pptTopics-Ch4Ch5.ppt
Topics-Ch4Ch5.ppt
 
Relational Model
Relational ModelRelational Model
Relational Model
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
DATABASE DESIGN.pptx
DATABASE DESIGN.pptxDATABASE DESIGN.pptx
DATABASE DESIGN.pptx
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
 
Databases - Unit 2.pdf
Databases - Unit 2.pdfDatabases - Unit 2.pdf
Databases - Unit 2.pdf
 
An hour with Database and SQL
An hour with Database and SQLAn hour with Database and SQL
An hour with Database and SQL
 
DBMS-Unit-2.pptx
DBMS-Unit-2.pptxDBMS-Unit-2.pptx
DBMS-Unit-2.pptx
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
er-models.pptx
er-models.pptxer-models.pptx
er-models.pptx
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
 

More from yash patel

English question with answer 301 to 400
English question with answer 301 to 400English question with answer 301 to 400
English question with answer 301 to 400yash patel
 
English grammar pdf for tet
English grammar pdf for tetEnglish grammar pdf for tet
English grammar pdf for tetyash patel
 
solar energy/de report
solar energy/de reportsolar energy/de report
solar energy/de reportyash patel
 
AUTO MAETIC AIR FELLING
AUTO MAETIC AIR FELLINGAUTO MAETIC AIR FELLING
AUTO MAETIC AIR FELLINGyash patel
 
Design report
Design report Design report
Design report yash patel
 
Compasssurveyin
CompasssurveyinCompasssurveyin
Compasssurveyinyash patel
 
The old man and the sea
The old man and the seaThe old man and the sea
The old man and the seayash patel
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship modelyash patel
 
Laplace transforms
Laplace transforms Laplace transforms
Laplace transforms yash patel
 
Superposition theorem
Superposition theoremSuperposition theorem
Superposition theoremyash patel
 
Permanent magnet moving iron type instruments
Permanent magnet moving iron type instrumentsPermanent magnet moving iron type instruments
Permanent magnet moving iron type instrumentsyash patel
 
Constant and variacles in c
Constant   and variacles in cConstant   and variacles in c
Constant and variacles in cyash patel
 
Freedomisnotfree
Freedomisnotfree   Freedomisnotfree
Freedomisnotfree yash patel
 

More from yash patel (20)

English question with answer 301 to 400
English question with answer 301 to 400English question with answer 301 to 400
English question with answer 301 to 400
 
English grammar pdf for tet
English grammar pdf for tetEnglish grammar pdf for tet
English grammar pdf for tet
 
solar energy/de report
solar energy/de reportsolar energy/de report
solar energy/de report
 
euler
 euler euler
euler
 
AUTO MAETIC AIR FELLING
AUTO MAETIC AIR FELLINGAUTO MAETIC AIR FELLING
AUTO MAETIC AIR FELLING
 
Design report
Design report Design report
Design report
 
Compasssurveyin
CompasssurveyinCompasssurveyin
Compasssurveyin
 
Tangent plane
Tangent planeTangent plane
Tangent plane
 
Wings of fire
Wings of fireWings of fire
Wings of fire
 
Pumps
PumpsPumps
Pumps
 
The old man and the sea
The old man and the seaThe old man and the sea
The old man and the sea
 
Function
FunctionFunction
Function
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
 
Block diagram
Block diagramBlock diagram
Block diagram
 
Laplace transforms
Laplace transforms Laplace transforms
Laplace transforms
 
Superposition theorem
Superposition theoremSuperposition theorem
Superposition theorem
 
Permanent magnet moving iron type instruments
Permanent magnet moving iron type instrumentsPermanent magnet moving iron type instruments
Permanent magnet moving iron type instruments
 
Constant and variacles in c
Constant   and variacles in cConstant   and variacles in c
Constant and variacles in c
 
Entropy
EntropyEntropy
Entropy
 
Freedomisnotfree
Freedomisnotfree   Freedomisnotfree
Freedomisnotfree
 

Recently uploaded

Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 

Recently uploaded (20)

Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 

Database management system

  • 3. Review - Concepts Relational Model is made up of tables • A row of table = a relational instance/tuple. • A column of table = an attribute • A table = a schema/relation • Cardinality = number of rows • Degree = number of columns http://alltypeim.blogspot.in/
  • 4. From ER Model to Relational Model So… how do we convert an ER diagram into a table?? Simple!! Basic Ideas:  Build a table for each entity set  Build a table for each relationship set if necessary  Make a column in the table for each attribute in the entity set.  Primary Key http://alltypeim.blogspot.in/
  • 5. Keys • Super Key • Super Key is defined as a set of attributes within a table that uniquely identifies each record within a table. Super Key is a superset of Candidate key. • Candidate Key • Candidate keys are defined as the set of fields from which primary key can be selected. It is an attribute or set of attribute that can act as a primary key for a table to uniquely identify each record in that table. • Primary Key • Primary key is a candidate key that is most appropriate to become main key of the table. It is a key that uniquely identify each record in a table. • http://alltypeim.blogspot.in/
  • 6. Strong Entity Set • An entity set that has a primary key is called as Strong entity set. • A member of a strong entity set is called dominant entity . • There is a single line connecting strong entity set with the relation. http://alltypeim.blogspot.in/
  • 7. Example – Strong Entity Set SID Name Major GPA 1234 John CS 2.8 5678 Mary EE 3.6 Student SID Name Major GPA Advisor Professor SSN Name Dept SSN Name Dept 9999 Smith Math 8888 Lee CS http://alltypeim.blogspot.in/
  • 8. Representation of Weak Entity Set • Weak Entity Set Cannot exist alone. • It does not have sufficient attributes to form a primary key of its own. • To build a table/schema for weak entity set :- – Construct a table with one column for each attribute in the weak entity set – Remember to include discriminator – Augment one extra column on the right side of the table, put in there the primary key of the Strong Entity Set (the entity set that the weak entity set is depending on) – Primary Key of the weak entity set = Discriminator + foreign key http://alltypeim.blogspot.in/
  • 9. Example – Weak Entity Set Age Name Parent_SID 10 Bart 1234 8 Lisa 5678 Student SID Name Major GPA Name Age Childrenowns * Primary key of Children is Parent_SID + Name http://alltypeim.blogspot.in/
  • 10. Representation of Relationship Set  Unary/Binary Relationship set  Depends on the cardinality and participation of the relationship  Two possible approaches  N-ary (multiple) Relationship set  Primary Key Issue  Identifying Relationship  No relational model representation necessary http://alltypeim.blogspot.in/
  • 11. Example – One-to-One Relationship Set SID Maj_ID Co S_Degree 9999 07 1234 8888 05 5678 Student SID Name Major GPA ID Code Majorstudy * Primary key can be either SID or Maj_ID_Co Degree http://alltypeim.blogspot.in/
  • 12. Example – One-to-One Relationship Set SID Name Major GPA LP_S/N Hav_Cond 9999 Bart Economy -4.0 123-456 Own 8888 Lisa Physics 4.0 567-890 Loan Student SID Name Major GPA S/N # LaptopHave * Primary key can be either SID or LP_S/N Condition Brand 1:1 Relationship http://alltypeim.blogspot.in/
  • 13. Example – Many-to-One Relationship Set SID Name Major GPA Pro_SSN Ad_Sem 9999 Bart Economy -4.0 123-456 Fall 2006 8888 Lisa Physics 4.0 567-890 Fall 2005 Student SID Name Major GPA SSN Professor * Primary key of this table is SID Semester Name N:1 Relationship Dept Advisor http://alltypeim.blogspot.in/
  • 14. Example – N-ary Relationship Set P-Key1 P-Key2 P-Key3 A-Key D-Attribute 9999 8888 7777 6666 Yes 1234 5678 9012 3456 No E-Set 1 P-Key1 Another Set * Primary key of this table is P-Key1 + P-Key2 + P-Key3 D-Attribute A relationship A-Key E-Set 2 P-Key2 E-Set 3 P-Key3 http://alltypeim.blogspot.in/
  • 15. Representing Composite Attribute • Relational Model Indivisibility Rule Applies • One column for each component attribute • NO column for the composite attribute itself Professor SSN Name Address SSN Name Street City 9999 Dr. Smith 50 1st St. Fake City 8888 Dr. Lee 1 B St. San Jose Street City http://alltypeim.blogspot.in/
  • 16. Representing Multivalue Attribute • For each multivalue attribute in an entity set/relationship set – Build a new relation schema with two columns – One column for the primary keys of the entity set/relationship set that has the multivalue attribute – Another column for the multivalue attributes. Each cell of this column holds only one value. So each value is represented as an unique tuple – Primary key for this schema is the union of all attributes http://alltypeim.blogspot.in/
  • 17. Example – Multivalue attribute SID Name Major GPA 1234 John CS 2.8 5678 Homer EE 3.6 Student SID Name Major GPA Stud_SID Children 1234 Johnson 1234 Mary 5678 Bart 5678 Lisa 5678 Maggie Children The primary key for this table is Student_SID + Children, the union of all attributes http://alltypeim.blogspot.in/