SlideShare a Scribd company logo
1 of 21
UNIT-II
RELATIONAL DATA MODEL AND LANGUAGE
Relational Data Model
'The 'Relational Database Model is the most common model in industry today.
A relational database is based on the relational model developed by E.F. Codd.
A relational database allows the definition of data structures, storage and retrieval operations
and integrity constraints. In such a database the data and relations between them are organized
into tables. A table is a collection of records and each record in a table contains the same fields.
Properties of the Relational database
model
Properties of Relational Tables:
1. Data is presented as a collection of relations.
2. Each relation is depicted as a table.
3. Columns are attributes that belong to the entity modelled by the table (ex. In a student
table, you could have name, address, student ID, major, etc.).
4. Each row ("tuple") represents a single entity (ex. In a student table, John Smith, 14 Oak St,
9002342, Accounting, would represent one student entity).
5. Every table has a set of attributes that taken together as a "key" (technically, a "superkey")
uniquely identifies each entity (Ex. In the student table, “student ID” would uniquely identify
each student – no two students would have the same student ID).
Concepts
Tables − In relational data model, relations are saved in the format of Tables. This format stores
the relation among entities. A table has rows and columns, where rows represents records and
columns represent the attributes.
Tuple − A single row of a table, which contains a single record for that relation is called a tuple.
Relation instance − A finite set of tuples in the relational database system represents relation
instance. Relation instances do not have duplicate tuples.
Relation schema − A relation schema describes the relation name (table name), attributes, and
their names.
Relation key − Each row has one or more attributes, known as relation key, which can identify
the row in the relation (table) uniquely.
Attribute domain − Every attribute has some pre-defined value scope, known as attribute
domain.
Relational Integrity Constraints
Every relation has some conditions that must hold for it to be a valid relation. These conditions
are called Relational Integrity Constraints. There are three main integrity constraints −
1. Key constraints
2. Domain constraints
3. Referential integrity constraints
Example
The diagram below shows a
conceptual model with two
associations: WrittenBy and
PublishedBy. The Book entity
type has a property, PublisherId,
that references the entity key of
the Publisher entity type when
you define a referential integrity
constrainst on the PublishedBy
association.
Key Constraints
There must be at least one minimal subset of attributes in the relation, which can identify a
tuple uniquely. This minimal subset of attributes is called key for that relation. If there are more
than one such minimal subsets, these are called candidate keys.
Key constraints force that −
in a relation with a key attribute, no two tuples can have identical values for key attributes.
a key attribute can not have NULL values.
Key constraints are also referred to as Entity Constraints.
Domain Constraints
Attributes have specific values in real-world scenario. For example, age can only be a positive
integer. The same constraints have been tried to employ on the attributes of a relation. Every
attribute is bound to have a specific range of values. For example, age cannot be less than zero
and telephone numbers cannot contain a digit outside 0-9.
Referential Integrity Constraints
Referential integrity constraints work on the concept of Foreign Keys. A foreign key is a key
attribute of a relation that can be referred in other relation.
Referential integrity constraint states that if a relation refers to a key attribute of a different or
same relation, then that key element must exist.
…
Referential integrity is a property of data which, when
satisfied, requires every value of one attribute (column)
of a relation (table) to exist as a value of another
attribute (column) in a different (or the same) relation
(table).
A foreign key (FK) is a column or combination of columns
that is used to establish and enforce a link between the
data in two tables.
Integrity
Data integrity refers to maintaining and assuring the
accuracy and consistency of data over its entire life-cycle,
and is a critical aspect to the design, implementation and
usage of any system which stores, processes, or retrieves
data.
Relational Database
Relational database systems are expected to be equipped with a query language that can assist
its users to query the database instances.
There are two kinds of query languages −
1. Relational algebra
2. Relational calculus.
Relational Algebra
The main application of relational algebra is providing a theoretical foundation for relational
databases, particularly query languages for such databases, chief among which is SQL.
Relational algebra is a theoritcal procedural query language, which takes instances of relations as
input and yields instances of relations as output. It uses operators to perform queries. An
operator can be either unary or binary. They accept relations as their input and yield relations as
their output. Relational algebra is performed recursively on a relation and intermediate results
are also considered relations.
The fundamental operations of relational algebra are as follows −
Select Project Union
Set Difference Cartesian product Rename
Select Operation (σ)
It selects tuples that satisfy the given predicate from a relation.
Notation − σp(r)
Where σ stands for selection predicate and r stands for relation. p is prepositional logic formula which may use
connectors like and, or, and not. These terms may use relational operators like − =, ≠, ≥, < , >, ≤.
For example −
σsubject = "database"(Books)
Output − Selects tuples from books where subject is 'database'.
σsubject = "database" and price = "450"(Books)
Output − Selects tuples from books where subject is 'database' and 'price' is 450.
σsubject = "database" and price = "450" or year > "2010"(Books)
Output − Selects tuples from books where subject is 'database' and 'price' is 450 or those books
published after 2010.
Project Operation (∏)
It projects column(s) that satisfy a given predicate.
Notation − ∏A1, A2, An (r)
Where A1, A2 , An are attribute names of relation r.
Duplicate rows are automatically eliminated, as relation is a set.
For example −
∏subject, author (Books)
◦ Output: Selects and projects columns named as subject and author from the relation Books.
Union Operation (∪)
It performs binary union between two given relations and is defined as −
Notation − r U s
Where r and s are either database relations or relation result set (temporary relation).
For a union operation to be valid, the following conditions must hold −
◦ r, and s must have the same number of attributes.
◦ Attribute domains must be compatible.
◦ Duplicate tuples are automatically eliminated.
For Example: ∏ author (Books) ∪ ∏ author (Articles)
◦ Output − Projects the names of the authors who have either written a book or an article or both.
Set Difference (−)
The result of set difference operation is tuples, which are present in one relation but are not in
the second relation.
Notation − r − s
Finds all the tuples that are present in r but not in s.
For Example: ∏ author (Books) − ∏ author (Articles)
◦ Output − Provides the name of authors who have written books but not articles.
Cartesian Product (Χ)
Combines information of two different relations into one.
Notation − r Χ s
Where r and s are relations and their output will be defined as −
σauthor = ‘nishant'(Books Χ Articles)
◦ Output − Yields a relation, which shows all the books and articles written by nishant.
Rename Operation (ρ)
The results of relational algebra are also relations but without any name. The rename operation
allows us to rename the output relation. 'rename' operation is denoted with small Greek letter
rho ρ.
Notation − ρ x (E)
Where the result of expression E is saved with name of x.
Relational Calculus
In contrast to Relational Algebra, Relational Calculus is a non-procedural query language, that is,
it tells what to do but never explains how to do it.
Relational calculus exists in two forms
◦ Tuple Relational Calculus (TRC)
◦ Domain Relational Calculus (DRC)
Tuple Relational Calculus
Filtering variable ranges over tuples.
Notation − {T | Condition}
Returns all tuples T that satisfies a condition.
For example −
{ T.name | Author(T) AND T.article = 'database' }
Output − Returns tuples with 'name' from Author who has written article on 'database'.
Domain Relational Calculus (DRC)
In DRC, the filtering variable uses the domain of attributes instead of entire tuple values (as
done in TRC, mentioned above).
Notation −
{ a1, a2, a3, ..., an | P (a1, a2, a3, ... ,an)}
Where a1, a2 are attributes and P stands for formulae built by inner attributes.
For example − {< article, page, subject > | ∈ Sahoo ∧ subject = 'database'}
Output − Yields Article, Page, and Subject from the relation Sahoo, where subject is database.
THANKSConnect: @nishantmunjal

More Related Content

What's hot

Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra pptGirdharRatne
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database DesignArchit Saxena
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMSkoolkampus
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and modelssabah N
 
Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbmssethu pm
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagramssadique_ghitm
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLEVraj Patel
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramShakila Mahjabin
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity ConstraintsMegha yadav
 
RELATIONSHIP IN DBMS.pptx
RELATIONSHIP IN DBMS.pptxRELATIONSHIP IN DBMS.pptx
RELATIONSHIP IN DBMS.pptxKAnurag2
 
Er model ppt
Er model pptEr model ppt
Er model pptPihu Goel
 

What's hot (20)

Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and models
 
Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbms
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
RELATIONSHIP IN DBMS.pptx
RELATIONSHIP IN DBMS.pptxRELATIONSHIP IN DBMS.pptx
RELATIONSHIP IN DBMS.pptx
 
SQL commands
SQL commandsSQL commands
SQL commands
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 

Viewers also liked

Database Management System
Database Management SystemDatabase Management System
Database Management SystemNishant Munjal
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data ModelSmriti Jain
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
4 the relational data model and relational database constraints
4 the relational data model and relational database constraints4 the relational data model and relational database constraints
4 the relational data model and relational database constraintsKumar
 
Technical education benchmarks
Technical education benchmarksTechnical education benchmarks
Technical education benchmarksNishant Munjal
 
Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03Jotham Gadot
 
Lecture 4 software process model (2)
Lecture 4   software process model (2)Lecture 4   software process model (2)
Lecture 4 software process model (2)IIUI
 
Virtualization, A Concept Implementation of Cloud
Virtualization, A Concept Implementation of CloudVirtualization, A Concept Implementation of Cloud
Virtualization, A Concept Implementation of CloudNishant Munjal
 
Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2eidah20
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Userssontumax
 
Database Systems - Relational Data Model (Chapter 2)
Database Systems - Relational Data Model (Chapter 2)Database Systems - Relational Data Model (Chapter 2)
Database Systems - Relational Data Model (Chapter 2)Vidyasagar Mundroy
 
introduction to database
 introduction to database introduction to database
introduction to databaseAkif shexi
 
Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Eddyzulham Mahluzydde
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS ConceptBoopathi K
 
Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)Vidyasagar Mundroy
 
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database ConstraintsThe Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraintssontumax
 
Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2Eddyzulham Mahluzydde
 

Viewers also liked (20)

Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Rdbms
RdbmsRdbms
Rdbms
 
4 the relational data model and relational database constraints
4 the relational data model and relational database constraints4 the relational data model and relational database constraints
4 the relational data model and relational database constraints
 
Sql
SqlSql
Sql
 
Bluemix Introduction
Bluemix IntroductionBluemix Introduction
Bluemix Introduction
 
Technical education benchmarks
Technical education benchmarksTechnical education benchmarks
Technical education benchmarks
 
Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03
 
Lecture 4 software process model (2)
Lecture 4   software process model (2)Lecture 4   software process model (2)
Lecture 4 software process model (2)
 
Virtualization, A Concept Implementation of Cloud
Virtualization, A Concept Implementation of CloudVirtualization, A Concept Implementation of Cloud
Virtualization, A Concept Implementation of Cloud
 
Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Users
 
Database Systems - Relational Data Model (Chapter 2)
Database Systems - Relational Data Model (Chapter 2)Database Systems - Relational Data Model (Chapter 2)
Database Systems - Relational Data Model (Chapter 2)
 
introduction to database
 introduction to database introduction to database
introduction to database
 
Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
 
Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)
 
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database ConstraintsThe Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraints
 
Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2
 

Similar to Relational Data Model Introduction

The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...Raj vardhan
 
Relational data model
Relational data modelRelational data model
Relational data modelSURBHI SAROHA
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database Rc Os
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]Bashir Rezaie
 
Relational Algebra Operations
Relational Algebra OperationsRelational Algebra Operations
Relational Algebra OperationsShefa Idrees
 
Relational algebra calculus
Relational algebra  calculusRelational algebra  calculus
Relational algebra calculusVaibhav Kathuria
 
structureformal1.ppt
structureformal1.pptstructureformal1.ppt
structureformal1.pptFaiz Zeya
 
relational model.pptx
relational model.pptxrelational model.pptx
relational model.pptxThangamaniR3
 
Fundamentals of database system - Relational data model and relational datab...
Fundamentals of database system  - Relational data model and relational datab...Fundamentals of database system  - Relational data model and relational datab...
Fundamentals of database system - Relational data model and relational datab...Mustafa Kamel Mohammadi
 
Relational database
Relational databaseRelational database
Relational databaseDucat
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Towards a New Data Modelling Architecture - Part 1
Towards a New Data Modelling Architecture - Part 1Towards a New Data Modelling Architecture - Part 1
Towards a New Data Modelling Architecture - Part 1JEAN-MICHEL LETENNIER
 
The theory of relational databases
The theory of relational databasesThe theory of relational databases
The theory of relational databasesSperasoft
 
Unit-II DBMS presentation for students.pdf
Unit-II DBMS presentation for students.pdfUnit-II DBMS presentation for students.pdf
Unit-II DBMS presentation for students.pdfajajkhan16
 
4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdf4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdfLPhct2
 

Similar to Relational Data Model Introduction (20)

The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
 
Relational data model
Relational data modelRelational data model
Relational data model
 
Relational Model
Relational ModelRelational Model
Relational Model
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]
 
Relational Algebra Operations
Relational Algebra OperationsRelational Algebra Operations
Relational Algebra Operations
 
Relational algebra calculus
Relational algebra  calculusRelational algebra  calculus
Relational algebra calculus
 
structureformal1.ppt
structureformal1.pptstructureformal1.ppt
structureformal1.ppt
 
relational model.pptx
relational model.pptxrelational model.pptx
relational model.pptx
 
Relational model
Relational modelRelational model
Relational model
 
Fundamentals of database system - Relational data model and relational datab...
Fundamentals of database system  - Relational data model and relational datab...Fundamentals of database system  - Relational data model and relational datab...
Fundamentals of database system - Relational data model and relational datab...
 
RDBMS
RDBMSRDBMS
RDBMS
 
Relational database
Relational databaseRelational database
Relational database
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Towards a New Data Modelling Architecture - Part 1
Towards a New Data Modelling Architecture - Part 1Towards a New Data Modelling Architecture - Part 1
Towards a New Data Modelling Architecture - Part 1
 
The theory of relational databases
The theory of relational databasesThe theory of relational databases
The theory of relational databases
 
Unit-II DBMS presentation for students.pdf
Unit-II DBMS presentation for students.pdfUnit-II DBMS presentation for students.pdf
Unit-II DBMS presentation for students.pdf
 
4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdf4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdf
 
DBMS Unit-2.pdf
DBMS Unit-2.pdfDBMS Unit-2.pdf
DBMS Unit-2.pdf
 

More from Nishant Munjal

Database Management System
Database Management SystemDatabase Management System
Database Management SystemNishant Munjal
 
Array, string and pointer
Array, string and pointerArray, string and pointer
Array, string and pointerNishant Munjal
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computersNishant Munjal
 
Shell Programming Concept
Shell Programming ConceptShell Programming Concept
Shell Programming ConceptNishant Munjal
 
Asynchronous Transfer Mode
Asynchronous Transfer ModeAsynchronous Transfer Mode
Asynchronous Transfer ModeNishant Munjal
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud ComputingNishant Munjal
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries InformationNishant Munjal
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization TechniquesNishant Munjal
 
Transaction Processing Concept
Transaction Processing ConceptTransaction Processing Concept
Transaction Processing ConceptNishant Munjal
 
Personnel Management and Industrial Psycology
Personnel Management and Industrial PsycologyPersonnel Management and Industrial Psycology
Personnel Management and Industrial PsycologyNishant Munjal
 
Principles of Management
Principles of ManagementPrinciples of Management
Principles of ManagementNishant Munjal
 

More from Nishant Munjal (20)

Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Functions & Recursion
Functions & RecursionFunctions & Recursion
Functions & Recursion
 
Array, string and pointer
Array, string and pointerArray, string and pointer
Array, string and pointer
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
 
Unix Administration
Unix AdministrationUnix Administration
Unix Administration
 
Shell Programming Concept
Shell Programming ConceptShell Programming Concept
Shell Programming Concept
 
VI Editor
VI EditorVI Editor
VI Editor
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Routing Techniques
Routing TechniquesRouting Techniques
Routing Techniques
 
Asynchronous Transfer Mode
Asynchronous Transfer ModeAsynchronous Transfer Mode
Asynchronous Transfer Mode
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud Computing
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization Techniques
 
Concurrency Control
Concurrency ControlConcurrency Control
Concurrency Control
 
Transaction Processing Concept
Transaction Processing ConceptTransaction Processing Concept
Transaction Processing Concept
 
Personnel Management and Industrial Psycology
Personnel Management and Industrial PsycologyPersonnel Management and Industrial Psycology
Personnel Management and Industrial Psycology
 
Marketing Management
Marketing ManagementMarketing Management
Marketing Management
 
Principles of Management
Principles of ManagementPrinciples of Management
Principles of Management
 
Industrial Economics
Industrial EconomicsIndustrial Economics
Industrial Economics
 

Recently uploaded

Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 

Recently uploaded (20)

Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 

Relational Data Model Introduction

  • 2. Relational Data Model 'The 'Relational Database Model is the most common model in industry today. A relational database is based on the relational model developed by E.F. Codd. A relational database allows the definition of data structures, storage and retrieval operations and integrity constraints. In such a database the data and relations between them are organized into tables. A table is a collection of records and each record in a table contains the same fields.
  • 3. Properties of the Relational database model Properties of Relational Tables: 1. Data is presented as a collection of relations. 2. Each relation is depicted as a table. 3. Columns are attributes that belong to the entity modelled by the table (ex. In a student table, you could have name, address, student ID, major, etc.). 4. Each row ("tuple") represents a single entity (ex. In a student table, John Smith, 14 Oak St, 9002342, Accounting, would represent one student entity). 5. Every table has a set of attributes that taken together as a "key" (technically, a "superkey") uniquely identifies each entity (Ex. In the student table, “student ID” would uniquely identify each student – no two students would have the same student ID).
  • 4. Concepts Tables − In relational data model, relations are saved in the format of Tables. This format stores the relation among entities. A table has rows and columns, where rows represents records and columns represent the attributes. Tuple − A single row of a table, which contains a single record for that relation is called a tuple. Relation instance − A finite set of tuples in the relational database system represents relation instance. Relation instances do not have duplicate tuples. Relation schema − A relation schema describes the relation name (table name), attributes, and their names. Relation key − Each row has one or more attributes, known as relation key, which can identify the row in the relation (table) uniquely. Attribute domain − Every attribute has some pre-defined value scope, known as attribute domain.
  • 5. Relational Integrity Constraints Every relation has some conditions that must hold for it to be a valid relation. These conditions are called Relational Integrity Constraints. There are three main integrity constraints − 1. Key constraints 2. Domain constraints 3. Referential integrity constraints
  • 6. Example The diagram below shows a conceptual model with two associations: WrittenBy and PublishedBy. The Book entity type has a property, PublisherId, that references the entity key of the Publisher entity type when you define a referential integrity constrainst on the PublishedBy association.
  • 7. Key Constraints There must be at least one minimal subset of attributes in the relation, which can identify a tuple uniquely. This minimal subset of attributes is called key for that relation. If there are more than one such minimal subsets, these are called candidate keys. Key constraints force that − in a relation with a key attribute, no two tuples can have identical values for key attributes. a key attribute can not have NULL values. Key constraints are also referred to as Entity Constraints.
  • 8. Domain Constraints Attributes have specific values in real-world scenario. For example, age can only be a positive integer. The same constraints have been tried to employ on the attributes of a relation. Every attribute is bound to have a specific range of values. For example, age cannot be less than zero and telephone numbers cannot contain a digit outside 0-9. Referential Integrity Constraints Referential integrity constraints work on the concept of Foreign Keys. A foreign key is a key attribute of a relation that can be referred in other relation. Referential integrity constraint states that if a relation refers to a key attribute of a different or same relation, then that key element must exist.
  • 9. … Referential integrity is a property of data which, when satisfied, requires every value of one attribute (column) of a relation (table) to exist as a value of another attribute (column) in a different (or the same) relation (table). A foreign key (FK) is a column or combination of columns that is used to establish and enforce a link between the data in two tables. Integrity Data integrity refers to maintaining and assuring the accuracy and consistency of data over its entire life-cycle, and is a critical aspect to the design, implementation and usage of any system which stores, processes, or retrieves data.
  • 10. Relational Database Relational database systems are expected to be equipped with a query language that can assist its users to query the database instances. There are two kinds of query languages − 1. Relational algebra 2. Relational calculus.
  • 11. Relational Algebra The main application of relational algebra is providing a theoretical foundation for relational databases, particularly query languages for such databases, chief among which is SQL. Relational algebra is a theoritcal procedural query language, which takes instances of relations as input and yields instances of relations as output. It uses operators to perform queries. An operator can be either unary or binary. They accept relations as their input and yield relations as their output. Relational algebra is performed recursively on a relation and intermediate results are also considered relations. The fundamental operations of relational algebra are as follows − Select Project Union Set Difference Cartesian product Rename
  • 12. Select Operation (σ) It selects tuples that satisfy the given predicate from a relation. Notation − σp(r) Where σ stands for selection predicate and r stands for relation. p is prepositional logic formula which may use connectors like and, or, and not. These terms may use relational operators like − =, ≠, ≥, < , >, ≤. For example − σsubject = "database"(Books) Output − Selects tuples from books where subject is 'database'. σsubject = "database" and price = "450"(Books) Output − Selects tuples from books where subject is 'database' and 'price' is 450. σsubject = "database" and price = "450" or year > "2010"(Books) Output − Selects tuples from books where subject is 'database' and 'price' is 450 or those books published after 2010.
  • 13. Project Operation (∏) It projects column(s) that satisfy a given predicate. Notation − ∏A1, A2, An (r) Where A1, A2 , An are attribute names of relation r. Duplicate rows are automatically eliminated, as relation is a set. For example − ∏subject, author (Books) ◦ Output: Selects and projects columns named as subject and author from the relation Books.
  • 14. Union Operation (∪) It performs binary union between two given relations and is defined as − Notation − r U s Where r and s are either database relations or relation result set (temporary relation). For a union operation to be valid, the following conditions must hold − ◦ r, and s must have the same number of attributes. ◦ Attribute domains must be compatible. ◦ Duplicate tuples are automatically eliminated. For Example: ∏ author (Books) ∪ ∏ author (Articles) ◦ Output − Projects the names of the authors who have either written a book or an article or both.
  • 15. Set Difference (−) The result of set difference operation is tuples, which are present in one relation but are not in the second relation. Notation − r − s Finds all the tuples that are present in r but not in s. For Example: ∏ author (Books) − ∏ author (Articles) ◦ Output − Provides the name of authors who have written books but not articles.
  • 16. Cartesian Product (Χ) Combines information of two different relations into one. Notation − r Χ s Where r and s are relations and their output will be defined as − σauthor = ‘nishant'(Books Χ Articles) ◦ Output − Yields a relation, which shows all the books and articles written by nishant.
  • 17. Rename Operation (ρ) The results of relational algebra are also relations but without any name. The rename operation allows us to rename the output relation. 'rename' operation is denoted with small Greek letter rho ρ. Notation − ρ x (E) Where the result of expression E is saved with name of x.
  • 18. Relational Calculus In contrast to Relational Algebra, Relational Calculus is a non-procedural query language, that is, it tells what to do but never explains how to do it. Relational calculus exists in two forms ◦ Tuple Relational Calculus (TRC) ◦ Domain Relational Calculus (DRC)
  • 19. Tuple Relational Calculus Filtering variable ranges over tuples. Notation − {T | Condition} Returns all tuples T that satisfies a condition. For example − { T.name | Author(T) AND T.article = 'database' } Output − Returns tuples with 'name' from Author who has written article on 'database'.
  • 20. Domain Relational Calculus (DRC) In DRC, the filtering variable uses the domain of attributes instead of entire tuple values (as done in TRC, mentioned above). Notation − { a1, a2, a3, ..., an | P (a1, a2, a3, ... ,an)} Where a1, a2 are attributes and P stands for formulae built by inner attributes. For example − {< article, page, subject > | ∈ Sahoo ∧ subject = 'database'} Output − Yields Article, Page, and Subject from the relation Sahoo, where subject is database.