SlideShare a Scribd company logo
1 of 28
MODULE 1
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Session 7
RELATIONAL MODEL
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
To build a database using SQL features and relational database
design concepts.
LEARNING OBJECTIVES
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
 Structure of Relational Model
 Attribute Types
 Database Schema
 Relation Instance
 Schema Diagram
 Keys
 Query Languages
OUTLINE
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Basic Structure of Relational Model
• Relational database consists of a collection of tables
• A row in a table represents a relationship among a set of
values
• Each row is a tuple
• Order in which tuples appear in a relation is irrelevant
5
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Basic Structure
t[account-number]=“A-101,”and t[branch-name] =“Downtown” (or) t[1]
6
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Basic Structure - Attribute Types
• The set of allowed values for each attribute is called the
domain of the attribute
• A tuple variable is a variable whose domain is the set of
all tuples.
• If Attribute values are atomic, it is indivisible
• The special value null is a member of every domain.
Indicated that the value is “unknown”
• The null value causes complications atmost needs to be
eliminated
7
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Relation Schema
• Schema of a relation consists of
– attribute definitions
• name
• type/domain
– integrity constraints
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Basic Structure – Relation Schema
• A1, A2, …, An are attributes
• R = (A1, A2, …, An ) is a relation schema
Example:
instructor = (ID, name, dept_name, salary)
• Formally, given sets D1, D2, …. Dn a relation r is a subset of
D1 x D2 x … x Dn
• Relation is a set of n-tuples (a1, a2, …, an) where each ai  Di
• Relation – cartesian product of domains
• The current values (relation instance) of a relation are
specified by a table
• An element t of r is a tuple, represented by a row in a table
9
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Basic Structure - Domains
• A1, A2, …, An are attributes
• R = (A1, A2, …, An ) is a relation schema
Example: if relation schema customer is defined
Customer=(customer-name, customer-street, customer-city)
customer-name = {Jones, Smith, Curry, Lindsay}
customer-street = {Main, North, Park}
customer-city = {Harrison, Rye, Pittsfield}
Then r = { (Jones, Main, Harrison),
(Smith, North, Rye),
(Curry, North, Rye),
(Lindsay, Park, Pittsfield)}
is a relation over customer-name x customer-street x
customer-city
10
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
RELATION INSTANCE
• The current values (relation instance) of a relation
are specified by a table
• An element t of r is a tuple, represented by a row in
a table
• Order of tuples is irrelevant (tuples may be stored
in an arbitrary order)
Jones
Smith
Curry
Lindsay
customer_name
Main
North
North
Park
customer_street
Harrison
Rye
Rye
Pittsfield
customer_city
customer
attributes
(or columns)
tuples
(or rows)
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Relation Instance
• The current values (relation instance) of a relation are
specified by a table
• An element t of r is a tuple, represented by a row in a
table
• Order of tuples is irrelevant (tuples may be stored in an
arbitrary order)
Jones
Smith
Curry
Lindsay
customer-name
Main
North
North
Park
customer-street
Harrison
Rye
Rye
Pittsfield
customer-city
customer
attributes
tuples
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Relations are Unordered
 Example: instructor relation with unordered tuples
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Database Schema
• Database schema – logical design of database
• Database instance - snapshot of the data in the database at
given instant in time.
• Lowercase names for relations
• Names begin with an uppercase letter for relation schemas
Account-schema =(account-number, branch-name, balance)
• Relation schema – consists of list of attributes with
corresponding domains
• account(Account-schema)
14
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Relation instance - notion of a value of a variable and it may
change with time
Attribute branch-name appears in both Branch-schema and
Account schema.
• Branch-schema =(branch-name, branch-city, assets)
• Account-schema =(account-number, branch-name, balance)
Relation schema
• Customer-schema =(customer-name, customer-street,
customer-city, account-number)
Relation between customer and account
• Depositor-schema =(customer-name, account-number)
15
Database Schema Cont..
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Attribute Types
• Each attribute of a relation has a name
• The set of allowed values for each attribute is called the
domain of the attribute
• Attribute values are (normally) required to be atomic, that is,
indivisible
– E.g. multivalued attribute values are not atomic
– E.g. composite attribute values are not atomic
• The special value null is a member of every domain
• The null value causes complications in the definition of many
operations
– we shall ignore the effect of null values in our main
presentation and consider their effect later
16
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
The customer Relation
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
The depositor Relation
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
E-R Diagram for the Banking Enterprise
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Keys
• Let K  R, K is a superkey of R if values for K are sufficient
to identify a unique tuple of each possible relation r(R)
t1 != t2, in relation R
– Example: {account-number},{ branch-name, account-
name} ,{account-name}- superkeys of account
• Superkey K is a candidate key if K is minimal
Example: {account-number} is a candidate key for account
• Foreign key constraint: Value in one relation must appear in
another (ta=tb)
– Referencing relation, Referenced relation
– Example – branch-name in account is a foreign key from
branch referencing account
20
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Determining Keys from E-R Sets
• Strong entity set. The primary key of the entity set
becomes the primary key of the relation.
• Weak entity set. The primary key of the relation
consists of the union of the primary key of the strong
entity set and the discriminator of the weak entity
set.
• Relationship set. The union of the primary keys of the
related entity sets becomes a super key of the
relation.
– For binary many-to-one relationship sets, the primary key of the “many” entity set becomes
the relation’s primary key.
– For one-to-one relationship sets, the relation’s primary key can be that of either entity set.
– For many-to-many relationship sets, the union of the primary keys becomes the relation’s
primary key
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
SCHEMA DIAGRAM
22CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
transform it into a normalized relational database schema.
Query Languages
• Language in which user requests information from the
database.
• Categories of languages
– procedural
– non-procedural
• “Pure” languages:
– Relational Algebra
– Tuple Relational Calculus
– Domain Relational Calculus
• Pure languages form underlying basis of query
languages that people use.
23
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
Summary
RELATIONAL MODEL
• Basic Structure
• Schema-Refers Logical Design
• Keys(Super key, primary key)
• Schema Diagram- Dipiction of schema
• Query Languages
24
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
LEARNING OUTCOME
The student will be able to Analyze and derive an information
model expressed in the form of an entity relation diagram and
transform it into Relational Model.
CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
employee (person name, street, city)
works (person name, company name, salary)
company (company name, city)
branch(branch name, branch city, assets)
customer (customer name, customer street, customer city)
loan (loan number, branch name, amount)
borrower (customer name, loan number)
account (account number, branch name, balance)
depositor (customer name, account number)
1. Consider the relational database of Figure ??. What are the
appropriate primary keys?
EXPECTED QUESTIONS
17CS307- DATABASE MANAGEMENT SYSTEMS
1. Describe the differences in meaning between the terms relation
and relation schema.
2. List two reasons why null values might be introduced into the
database.
3. Discuss the relative merits of procedural and nonprocedural
languages.
EXPECTED QUESTIONS
17CS307- DATABASE MANAGEMENT SYSTEMS
28
In the next session, we will discuss about Relational Algebra
17CS307- DATABASE MANAGEMENT SYSTEMS

More Related Content

What's hot

Relational algebra.pptx
Relational algebra.pptxRelational algebra.pptx
Relational algebra.pptxRUpaliLohar
 
D I T211 Chapter 6
D I T211    Chapter 6D I T211    Chapter 6
D I T211 Chapter 6askme
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational CalculusKunal Anand
 
Relational algebra
Relational algebraRelational algebra
Relational algebrashynajain
 
Preparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001dPreparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001dGihan Wikramanayake
 

What's hot (7)

Lllll
LllllLllll
Lllll
 
Relational algebra.pptx
Relational algebra.pptxRelational algebra.pptx
Relational algebra.pptx
 
D I T211 Chapter 6
D I T211    Chapter 6D I T211    Chapter 6
D I T211 Chapter 6
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational Calculus
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
relational algebra
relational algebrarelational algebra
relational algebra
 
Preparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001dPreparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001d
 

Similar to 7.relational model

Relational model
Relational modelRelational model
Relational modelRUpaliLohar
 
Data Base Management system relation algebra ER diageam Sql Query -nested qu...
Data Base Management system relation algebra ER diageam Sql Query -nested  qu...Data Base Management system relation algebra ER diageam Sql Query -nested  qu...
Data Base Management system relation algebra ER diageam Sql Query -nested qu...kudiyarc
 
relational model in Database Management.ppt.ppt
relational model in Database Management.ppt.pptrelational model in Database Management.ppt.ppt
relational model in Database Management.ppt.pptRoshni814224
 
Relational Model on Database management PPT
Relational Model on Database management PPTRelational Model on Database management PPT
Relational Model on Database management PPTssuser3e0f731
 
Relational Algebra
Relational AlgebraRelational Algebra
Relational AlgebraAmin Omi
 
Relational model and its utility%28 rajkumar%29.pptx
Relational model and its       utility%28 rajkumar%29.pptxRelational model and its       utility%28 rajkumar%29.pptx
Relational model and its utility%28 rajkumar%29.pptxRajkumar Mondal
 
3. Relational Models in DBMS
3. Relational Models in DBMS3. Relational Models in DBMS
3. Relational Models in DBMSkoolkampus
 
4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdf4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdfLPhct2
 
Dbms chapter vii
Dbms chapter viiDbms chapter vii
Dbms chapter viiBala Ganesh
 
19IS305_U1_LP3_LM3-22-23-2.pdf
19IS305_U1_LP3_LM3-22-23-2.pdf19IS305_U1_LP3_LM3-22-23-2.pdf
19IS305_U1_LP3_LM3-22-23-2.pdfGOWTHAMR721887
 

Similar to 7.relational model (20)

Relational model
Relational modelRelational model
Relational model
 
Data Base Management system relation algebra ER diageam Sql Query -nested qu...
Data Base Management system relation algebra ER diageam Sql Query -nested  qu...Data Base Management system relation algebra ER diageam Sql Query -nested  qu...
Data Base Management system relation algebra ER diageam Sql Query -nested qu...
 
3.ppt
3.ppt3.ppt
3.ppt
 
relational model in Database Management.ppt.ppt
relational model in Database Management.ppt.pptrelational model in Database Management.ppt.ppt
relational model in Database Management.ppt.ppt
 
Relational Model on Database management PPT
Relational Model on Database management PPTRelational Model on Database management PPT
Relational Model on Database management PPT
 
Relational Algebra
Relational AlgebraRelational Algebra
Relational Algebra
 
Relational model and its utility%28 rajkumar%29.pptx
Relational model and its       utility%28 rajkumar%29.pptxRelational model and its       utility%28 rajkumar%29.pptx
Relational model and its utility%28 rajkumar%29.pptx
 
Relational model
Relational modelRelational model
Relational model
 
3. Relational Models in DBMS
3. Relational Models in DBMS3. Relational Models in DBMS
3. Relational Models in DBMS
 
Relational model
Relational modelRelational model
Relational model
 
Details of RDBMS.ppt
Details of RDBMS.pptDetails of RDBMS.ppt
Details of RDBMS.ppt
 
DBMS Class 3
DBMS Class 3DBMS Class 3
DBMS Class 3
 
14285 lecture2
14285 lecture214285 lecture2
14285 lecture2
 
Dbms relational data model and sql queries
Dbms relational data model and sql queries Dbms relational data model and sql queries
Dbms relational data model and sql queries
 
DBMS Unit-2.pdf
DBMS Unit-2.pdfDBMS Unit-2.pdf
DBMS Unit-2.pdf
 
4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdf4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdf
 
Dbms chapter vii
Dbms chapter viiDbms chapter vii
Dbms chapter vii
 
Unit 04 dbms
Unit 04 dbmsUnit 04 dbms
Unit 04 dbms
 
RDBMS
RDBMSRDBMS
RDBMS
 
19IS305_U1_LP3_LM3-22-23-2.pdf
19IS305_U1_LP3_LM3-22-23-2.pdf19IS305_U1_LP3_LM3-22-23-2.pdf
19IS305_U1_LP3_LM3-22-23-2.pdf
 

Recently uploaded

Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 

Recently uploaded (20)

Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 

7.relational model

  • 1. MODULE 1 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and Session 7
  • 2. RELATIONAL MODEL CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 3. To build a database using SQL features and relational database design concepts. LEARNING OBJECTIVES CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 4.  Structure of Relational Model  Attribute Types  Database Schema  Relation Instance  Schema Diagram  Keys  Query Languages OUTLINE CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 5. Basic Structure of Relational Model • Relational database consists of a collection of tables • A row in a table represents a relationship among a set of values • Each row is a tuple • Order in which tuples appear in a relation is irrelevant 5 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 6. Basic Structure t[account-number]=“A-101,”and t[branch-name] =“Downtown” (or) t[1] 6 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 7. Basic Structure - Attribute Types • The set of allowed values for each attribute is called the domain of the attribute • A tuple variable is a variable whose domain is the set of all tuples. • If Attribute values are atomic, it is indivisible • The special value null is a member of every domain. Indicated that the value is “unknown” • The null value causes complications atmost needs to be eliminated 7 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 8. Relation Schema • Schema of a relation consists of – attribute definitions • name • type/domain – integrity constraints CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 9. Basic Structure – Relation Schema • A1, A2, …, An are attributes • R = (A1, A2, …, An ) is a relation schema Example: instructor = (ID, name, dept_name, salary) • Formally, given sets D1, D2, …. Dn a relation r is a subset of D1 x D2 x … x Dn • Relation is a set of n-tuples (a1, a2, …, an) where each ai  Di • Relation – cartesian product of domains • The current values (relation instance) of a relation are specified by a table • An element t of r is a tuple, represented by a row in a table 9 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 10. Basic Structure - Domains • A1, A2, …, An are attributes • R = (A1, A2, …, An ) is a relation schema Example: if relation schema customer is defined Customer=(customer-name, customer-street, customer-city) customer-name = {Jones, Smith, Curry, Lindsay} customer-street = {Main, North, Park} customer-city = {Harrison, Rye, Pittsfield} Then r = { (Jones, Main, Harrison), (Smith, North, Rye), (Curry, North, Rye), (Lindsay, Park, Pittsfield)} is a relation over customer-name x customer-street x customer-city 10 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 11. RELATION INSTANCE • The current values (relation instance) of a relation are specified by a table • An element t of r is a tuple, represented by a row in a table • Order of tuples is irrelevant (tuples may be stored in an arbitrary order) Jones Smith Curry Lindsay customer_name Main North North Park customer_street Harrison Rye Rye Pittsfield customer_city customer attributes (or columns) tuples (or rows) CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 12. Relation Instance • The current values (relation instance) of a relation are specified by a table • An element t of r is a tuple, represented by a row in a table • Order of tuples is irrelevant (tuples may be stored in an arbitrary order) Jones Smith Curry Lindsay customer-name Main North North Park customer-street Harrison Rye Rye Pittsfield customer-city customer attributes tuples CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 13. Relations are Unordered  Example: instructor relation with unordered tuples CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 14. Database Schema • Database schema – logical design of database • Database instance - snapshot of the data in the database at given instant in time. • Lowercase names for relations • Names begin with an uppercase letter for relation schemas Account-schema =(account-number, branch-name, balance) • Relation schema – consists of list of attributes with corresponding domains • account(Account-schema) 14 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 15. Relation instance - notion of a value of a variable and it may change with time Attribute branch-name appears in both Branch-schema and Account schema. • Branch-schema =(branch-name, branch-city, assets) • Account-schema =(account-number, branch-name, balance) Relation schema • Customer-schema =(customer-name, customer-street, customer-city, account-number) Relation between customer and account • Depositor-schema =(customer-name, account-number) 15 Database Schema Cont.. CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 16. Attribute Types • Each attribute of a relation has a name • The set of allowed values for each attribute is called the domain of the attribute • Attribute values are (normally) required to be atomic, that is, indivisible – E.g. multivalued attribute values are not atomic – E.g. composite attribute values are not atomic • The special value null is a member of every domain • The null value causes complications in the definition of many operations – we shall ignore the effect of null values in our main presentation and consider their effect later 16 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 17. The customer Relation CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 18. The depositor Relation CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 19. E-R Diagram for the Banking Enterprise CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 20. Keys • Let K  R, K is a superkey of R if values for K are sufficient to identify a unique tuple of each possible relation r(R) t1 != t2, in relation R – Example: {account-number},{ branch-name, account- name} ,{account-name}- superkeys of account • Superkey K is a candidate key if K is minimal Example: {account-number} is a candidate key for account • Foreign key constraint: Value in one relation must appear in another (ta=tb) – Referencing relation, Referenced relation – Example – branch-name in account is a foreign key from branch referencing account 20 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 21. Determining Keys from E-R Sets • Strong entity set. The primary key of the entity set becomes the primary key of the relation. • Weak entity set. The primary key of the relation consists of the union of the primary key of the strong entity set and the discriminator of the weak entity set. • Relationship set. The union of the primary keys of the related entity sets becomes a super key of the relation. – For binary many-to-one relationship sets, the primary key of the “many” entity set becomes the relation’s primary key. – For one-to-one relationship sets, the relation’s primary key can be that of either entity set. – For many-to-many relationship sets, the union of the primary keys becomes the relation’s primary key CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 22. SCHEMA DIAGRAM 22CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and transform it into a normalized relational database schema.
  • 23. Query Languages • Language in which user requests information from the database. • Categories of languages – procedural – non-procedural • “Pure” languages: – Relational Algebra – Tuple Relational Calculus – Domain Relational Calculus • Pure languages form underlying basis of query languages that people use. 23 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 24. Summary RELATIONAL MODEL • Basic Structure • Schema-Refers Logical Design • Keys(Super key, primary key) • Schema Diagram- Dipiction of schema • Query Languages 24 CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 25. LEARNING OUTCOME The student will be able to Analyze and derive an information model expressed in the form of an entity relation diagram and transform it into Relational Model. CO2:Analyze and derive an information model expressed in the form of an entity relation diagram and
  • 26. employee (person name, street, city) works (person name, company name, salary) company (company name, city) branch(branch name, branch city, assets) customer (customer name, customer street, customer city) loan (loan number, branch name, amount) borrower (customer name, loan number) account (account number, branch name, balance) depositor (customer name, account number) 1. Consider the relational database of Figure ??. What are the appropriate primary keys? EXPECTED QUESTIONS 17CS307- DATABASE MANAGEMENT SYSTEMS
  • 27. 1. Describe the differences in meaning between the terms relation and relation schema. 2. List two reasons why null values might be introduced into the database. 3. Discuss the relative merits of procedural and nonprocedural languages. EXPECTED QUESTIONS 17CS307- DATABASE MANAGEMENT SYSTEMS
  • 28. 28 In the next session, we will discuss about Relational Algebra 17CS307- DATABASE MANAGEMENT SYSTEMS