SlideShare a Scribd company logo
1
Introduction to Relational
Databases
A.Bathsheba Parimala
Assistant Professor
St.Johns College,Palayamkottai
2
Some Preliminaries
The theory taught in this part of the course was originally
devised by Edgar F. Codd in 1969. His seminal paper (1970)
was entitled A Relational Model of Data for Large Shared
Data Banks.
We will use a language called Tutorial D for examples and
exercises.
We will use Rel, an implementation of Tutorial D, for our on-
line work.
3
What Is a Database?
An organised, machine-readable collection
of symbols, to be interpreted as a true
account of some enterprise.
Machine-updatable, too …
… so a database is also a collection of variables.
A database is typically available to a community
of users, with possibly varying requirements.
4
“Organised Collection of
Symbols”
StudentId Name CourseId
S1 Anne C1
S1 Anne C2
S2 Boris C1
S3 Cindy C3
For example:
The symbols are organised into rows and columns, thus
forming a table. One of the rows is different in kind from the
others.
5
“To Be Interpreted as a True
Account”
StudentId Name CourseId
S1 Anne C1
For example (from the table just shown):
“Student S1, named Anne, is enrolled on course C1.”
Perhaps those green symbols, organised as they are with
respect to the blue ones, are to be understood to mean:
6
“Collection of Variables”
StudentId Name CourseId
S1 Anne C1
S1 Anne C2
S2 Boris C1
S3 Cindy C3
S4 Devinder C1
ENROLMENT is a variable. Perhaps the table we saw earlier
was once its value. If so, it (the variable) has been updated
since then (the row for S4 has been added).
ENROLMENT
7
What Is a Relational Database?
A database whose symbols are organised into a
collection of relations. Here is a relation, shown in
tabular form:
Might be the value currently assigned to ENROLMENT, a
relation variable (“relvar”).
StudentId Name CourseId
S1 Anne C1
S1 Anne C2
S2 Boris C1
S3 Cindy C3
S4 Devinder C1
8
“Relation” not equal to “Table”
This table is different from the one we have just seen,
but it represents the same relation:
Name StudentId CourseId
Devinder S4 C1
Cindy S3 C3
Anne S1 C1
Boris S2 C1
Anne S1 C2
In other words, the relation represented does not
depend on the order in which we place the rows or the
columns in the table.
9
Anatomy of a Relation
StudentId Name CourseId
S1 Anne C1
attribute name attribute values n-tuple, or tuple.
This is a 3-tuple.
The tuples
constitute the body
of the relation.
The number of
tuples in the body
is the cardinality of
the relation.
Heading (a set of attributes)
The degree of this heading is 3,
which is also the degree of the relation.
10
What Is a DBMS?
A piece of software for managing databases
and providing access to them.
A DBMS responds to imperatives (“statements”)
given by application programs, custom-written
or general-purpose, executing on behalf of users.
Imperatives are written in the database language
of the DBMS (e.g., SQL).
Responses include completion codes, messages and
results of queries.
11
What Does a DBMS Do?
Now, how does a relational DBMS do these things? …
• creates and destroys variables
• updates variables (honouring constraints and
authorisations)
• takes note of integrity rules (constraints)
• provides results of queries
• takes note of authorisations (who is allowed to do
what, to what)
• and more
In response to requests given by application programs:
12
Create and Destroy Variables
VAR ENROLMENT BASE RELATION
{ StudentId SID ,
Name CHAR,
CourseId CID }
KEY { StudentId, CourseId } ;
Creation (in Tutorial D):
Destruction:
DROP VAR ENROLMENT ;
13
Take Note of Integrity Rules
CONSTRAINT MAX_ENROLMENTS
COUNT ( ENROLMENT ) <= 20000 ;
E.g., can’t have more than 20,000 enrolments altogether. In
Tutorial D:
And if a constraint ceases to be applicable:
DROP CONSTRAINT MAX_ENROLMENTS ;
14
Take Note of Authorisations
PERMISSION U9_ENROLMENT FOR User9
TO READ ENROLMENT ;
E.g. (perhaps – but not in Tutorial D):
Permissions sometimes need to be withdrawn:
DROP PERMISSION U9_ENROLMENT ;
PERMISSION U8_ENROLMENT FOR User8
TO UPDATE ENROLMENT ;
15
Updates Variables
DELETE ENROLMENT WHERE StudentId =
SID ( ‘S4’ ) ;
E.g.:
UPDATE ENROLMENT WHERE StudentId =
SID ( ‘S1’ ) Name := ‘Ann’ ;
INSERT ENROLMENT
RELATION {
TUPLE { StudentId SID ( ‘S4’ ) ,
Name ‘Devinder’ ,
CourseId CID ( ‘C1’ ) } } ;
16
Provides Results of Queries
(ENROLMENT WHERE CourseId = CID(‘C1’))
{ StudentId, Name }
E.g.: Who is enrolled on course C1?
The result is another relation! In tabular form:
StudentId Name
S1 Anne
S2 Boris
S4 Devinder
17
EXERCISE
Consider this table:
A B A
1 2 3
4 5
6 7 8
9 9 ?
1 2 3
Give three reasons why it cannot be representing a relation.
18
IMPORTANT BIT OF ADMIN
Are you:
(a) an overseas student visiting for just one year, or
(b) doing a degree that is completely outside the CS
department? (In which case you should complete an
Unusual Option Form, obtainable from your dept secretary)
If so, on exit from this lecture:
Write your name, ITS userid, and course code on the sheet of
paper provided.
Otherwise you won’t get access to the software needed
for the Worksheets!

More Related Content

What's hot

DBMS CS2
DBMS CS2DBMS CS2
Structure in C language
Structure in C languageStructure in C language
Structure in C language
CGC Technical campus,Mohali
 
5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMS5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMSkoolkampus
 
Sv data types and sv interface usage in uvm
Sv data types and sv interface usage in uvmSv data types and sv interface usage in uvm
Sv data types and sv interface usage in uvm
HARINATH REDDY
 
Structure in C
Structure in CStructure in C
Structure in C
Kamal Acharya
 
Chapter15 structure
Chapter15 structureChapter15 structure
Chapter15 structureDeepak Singh
 
Relational Model
Relational ModelRelational Model
Relational Model
A. S. M. Shafi
 
Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive
Raj Naik
 
Basic Data Types in C++
Basic Data Types in C++ Basic Data Types in C++
Basic Data Types in C++
Hridoy Bepari
 
Data types
Data typesData types
Data types
Nokesh Prabhakar
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-c
teach4uin
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
Harshita Yadav
 
Computer data type and Terminologies
Computer data type and Terminologies Computer data type and Terminologies
Computer data type and Terminologies
glyvive
 
DBMS CS 4-5
DBMS CS 4-5DBMS CS 4-5
Database Normalisation
Database NormalisationDatabase Normalisation
Database Normalisation
Amin Omi
 
Numerical data.
Numerical data.Numerical data.
Numerical data.
Adewumi Ezekiel Adebayo
 
pointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handlingpointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handling
Rai University
 

What's hot (20)

DBMS CS2
DBMS CS2DBMS CS2
DBMS CS2
 
Structure in C language
Structure in C languageStructure in C language
Structure in C language
 
5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMS5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMS
 
Sv data types and sv interface usage in uvm
Sv data types and sv interface usage in uvmSv data types and sv interface usage in uvm
Sv data types and sv interface usage in uvm
 
Structure in C
Structure in CStructure in C
Structure in C
 
Lect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer AbbasLect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer Abbas
 
Chap 2(const var-datatype)
Chap 2(const var-datatype)Chap 2(const var-datatype)
Chap 2(const var-datatype)
 
Chapter15 structure
Chapter15 structureChapter15 structure
Chapter15 structure
 
Relational Model
Relational ModelRelational Model
Relational Model
 
Structures
StructuresStructures
Structures
 
Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive
 
Basic Data Types in C++
Basic Data Types in C++ Basic Data Types in C++
Basic Data Types in C++
 
Data types
Data typesData types
Data types
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-c
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Computer data type and Terminologies
Computer data type and Terminologies Computer data type and Terminologies
Computer data type and Terminologies
 
DBMS CS 4-5
DBMS CS 4-5DBMS CS 4-5
DBMS CS 4-5
 
Database Normalisation
Database NormalisationDatabase Normalisation
Database Normalisation
 
Numerical data.
Numerical data.Numerical data.
Numerical data.
 
pointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handlingpointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handling
 

Similar to Relational dbms

RDB-fundamentals-1-intro.ppt
RDB-fundamentals-1-intro.pptRDB-fundamentals-1-intro.ppt
RDB-fundamentals-1-intro.ppt
THEFPS
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbms
Anjaan Gajendra
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Siti Ismail
 
MIS201 SQL database .pdf
MIS201  SQL database .pdfMIS201  SQL database .pdf
MIS201 SQL database .pdf
DrSalehAlSaleh
 
NMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.pptNMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.ppt
IswaryaPurushothaman1
 
Conceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-modelsConceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-models
Shailaja Jayaprakash
 
Java 2 chapter 10 - basic oop in java
Java 2   chapter 10 - basic oop in javaJava 2   chapter 10 - basic oop in java
Java 2 chapter 10 - basic oop in javalet's go to study
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database
Rc Os
 
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.pptMODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
HemaSenthil5
 
MODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in designMODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in design
HemaSenthil5
 
introduction of database in DBMS
introduction of database in DBMSintroduction of database in DBMS
introduction of database in DBMS
AbhishekRajpoot8
 
Chapter Seven- JDBC.pptx
Chapter Seven- JDBC.pptxChapter Seven- JDBC.pptx
Chapter Seven- JDBC.pptx
BlenKassahun1
 
Bt0066 dbms
Bt0066 dbmsBt0066 dbms
Bt0066 dbms
smumbahelp
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
NIVETHA37590
 
Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013
Prosanta Ghosh
 
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docxL1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
DIPESH30
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental concepts
Kuntal Bhowmick
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbms
Anjaan Gajendra
 

Similar to Relational dbms (20)

RDB-fundamentals-1-intro.ppt
RDB-fundamentals-1-intro.pptRDB-fundamentals-1-intro.ppt
RDB-fundamentals-1-intro.ppt
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbms
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
MIS201 SQL database .pdf
MIS201  SQL database .pdfMIS201  SQL database .pdf
MIS201 SQL database .pdf
 
2 rel-algebra
2 rel-algebra2 rel-algebra
2 rel-algebra
 
ch2
ch2ch2
ch2
 
NMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.pptNMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.ppt
 
Conceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-modelsConceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-models
 
Java 2 chapter 10 - basic oop in java
Java 2   chapter 10 - basic oop in javaJava 2   chapter 10 - basic oop in java
Java 2 chapter 10 - basic oop in java
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database
 
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.pptMODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
 
MODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in designMODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in design
 
introduction of database in DBMS
introduction of database in DBMSintroduction of database in DBMS
introduction of database in DBMS
 
Chapter Seven- JDBC.pptx
Chapter Seven- JDBC.pptxChapter Seven- JDBC.pptx
Chapter Seven- JDBC.pptx
 
Bt0066 dbms
Bt0066 dbmsBt0066 dbms
Bt0066 dbms
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013
 
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docxL1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental concepts
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbms
 

More from Bathshebaparimala

C programming structures &amp; union
C programming structures &amp; unionC programming structures &amp; union
C programming structures &amp; union
Bathshebaparimala
 
An enhanced liver stages classification in 3 d ct and 3d-us images using glrl...
An enhanced liver stages classification in 3 d ct and 3d-us images using glrl...An enhanced liver stages classification in 3 d ct and 3d-us images using glrl...
An enhanced liver stages classification in 3 d ct and 3d-us images using glrl...
Bathshebaparimala
 
Assessment
AssessmentAssessment
Assessment
Bathshebaparimala
 
Normalization
NormalizationNormalization
Normalization
Bathshebaparimala
 
Protocols and its standards
Protocols and its standardsProtocols and its standards
Protocols and its standards
Bathshebaparimala
 
Unit v
Unit vUnit v
Hint for transmission media
Hint for transmission mediaHint for transmission media
Hint for transmission media
Bathshebaparimala
 
Osi model detail description
Osi model  detail descriptionOsi model  detail description
Osi model detail description
Bathshebaparimala
 
Creating a rainbow using graphics programming in c
Creating a rainbow using graphics programming in cCreating a rainbow using graphics programming in c
Creating a rainbow using graphics programming in c
Bathshebaparimala
 
Network layer
Network layerNetwork layer
Network layer
Bathshebaparimala
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
Bathshebaparimala
 
Assembly language
Assembly languageAssembly language
Assembly language
Bathshebaparimala
 
Routing
RoutingRouting
Transport layer
Transport layerTransport layer
Transport layer
Bathshebaparimala
 
Generation of Computer Network
Generation of Computer NetworkGeneration of Computer Network
Generation of Computer Network
Bathshebaparimala
 
Network -Lecture Notes
Network -Lecture NotesNetwork -Lecture Notes
Network -Lecture Notes
Bathshebaparimala
 
Segmentation of Machine learning Algorithm
Segmentation of Machine learning AlgorithmSegmentation of Machine learning Algorithm
Segmentation of Machine learning Algorithm
Bathshebaparimala
 
Osireferencemodel
OsireferencemodelOsireferencemodel
Osireferencemodel
Bathshebaparimala
 
Transmission media
Transmission mediaTransmission media
Transmission media
Bathshebaparimala
 
Osi model
Osi modelOsi model

More from Bathshebaparimala (20)

C programming structures &amp; union
C programming structures &amp; unionC programming structures &amp; union
C programming structures &amp; union
 
An enhanced liver stages classification in 3 d ct and 3d-us images using glrl...
An enhanced liver stages classification in 3 d ct and 3d-us images using glrl...An enhanced liver stages classification in 3 d ct and 3d-us images using glrl...
An enhanced liver stages classification in 3 d ct and 3d-us images using glrl...
 
Assessment
AssessmentAssessment
Assessment
 
Normalization
NormalizationNormalization
Normalization
 
Protocols and its standards
Protocols and its standardsProtocols and its standards
Protocols and its standards
 
Unit v
Unit vUnit v
Unit v
 
Hint for transmission media
Hint for transmission mediaHint for transmission media
Hint for transmission media
 
Osi model detail description
Osi model  detail descriptionOsi model  detail description
Osi model detail description
 
Creating a rainbow using graphics programming in c
Creating a rainbow using graphics programming in cCreating a rainbow using graphics programming in c
Creating a rainbow using graphics programming in c
 
Network layer
Network layerNetwork layer
Network layer
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Assembly language
Assembly languageAssembly language
Assembly language
 
Routing
RoutingRouting
Routing
 
Transport layer
Transport layerTransport layer
Transport layer
 
Generation of Computer Network
Generation of Computer NetworkGeneration of Computer Network
Generation of Computer Network
 
Network -Lecture Notes
Network -Lecture NotesNetwork -Lecture Notes
Network -Lecture Notes
 
Segmentation of Machine learning Algorithm
Segmentation of Machine learning AlgorithmSegmentation of Machine learning Algorithm
Segmentation of Machine learning Algorithm
 
Osireferencemodel
OsireferencemodelOsireferencemodel
Osireferencemodel
 
Transmission media
Transmission mediaTransmission media
Transmission media
 
Osi model
Osi modelOsi model
Osi model
 

Recently uploaded

14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
top1002
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 

Recently uploaded (20)

14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 

Relational dbms

  • 1. 1 Introduction to Relational Databases A.Bathsheba Parimala Assistant Professor St.Johns College,Palayamkottai
  • 2. 2 Some Preliminaries The theory taught in this part of the course was originally devised by Edgar F. Codd in 1969. His seminal paper (1970) was entitled A Relational Model of Data for Large Shared Data Banks. We will use a language called Tutorial D for examples and exercises. We will use Rel, an implementation of Tutorial D, for our on- line work.
  • 3. 3 What Is a Database? An organised, machine-readable collection of symbols, to be interpreted as a true account of some enterprise. Machine-updatable, too … … so a database is also a collection of variables. A database is typically available to a community of users, with possibly varying requirements.
  • 4. 4 “Organised Collection of Symbols” StudentId Name CourseId S1 Anne C1 S1 Anne C2 S2 Boris C1 S3 Cindy C3 For example: The symbols are organised into rows and columns, thus forming a table. One of the rows is different in kind from the others.
  • 5. 5 “To Be Interpreted as a True Account” StudentId Name CourseId S1 Anne C1 For example (from the table just shown): “Student S1, named Anne, is enrolled on course C1.” Perhaps those green symbols, organised as they are with respect to the blue ones, are to be understood to mean:
  • 6. 6 “Collection of Variables” StudentId Name CourseId S1 Anne C1 S1 Anne C2 S2 Boris C1 S3 Cindy C3 S4 Devinder C1 ENROLMENT is a variable. Perhaps the table we saw earlier was once its value. If so, it (the variable) has been updated since then (the row for S4 has been added). ENROLMENT
  • 7. 7 What Is a Relational Database? A database whose symbols are organised into a collection of relations. Here is a relation, shown in tabular form: Might be the value currently assigned to ENROLMENT, a relation variable (“relvar”). StudentId Name CourseId S1 Anne C1 S1 Anne C2 S2 Boris C1 S3 Cindy C3 S4 Devinder C1
  • 8. 8 “Relation” not equal to “Table” This table is different from the one we have just seen, but it represents the same relation: Name StudentId CourseId Devinder S4 C1 Cindy S3 C3 Anne S1 C1 Boris S2 C1 Anne S1 C2 In other words, the relation represented does not depend on the order in which we place the rows or the columns in the table.
  • 9. 9 Anatomy of a Relation StudentId Name CourseId S1 Anne C1 attribute name attribute values n-tuple, or tuple. This is a 3-tuple. The tuples constitute the body of the relation. The number of tuples in the body is the cardinality of the relation. Heading (a set of attributes) The degree of this heading is 3, which is also the degree of the relation.
  • 10. 10 What Is a DBMS? A piece of software for managing databases and providing access to them. A DBMS responds to imperatives (“statements”) given by application programs, custom-written or general-purpose, executing on behalf of users. Imperatives are written in the database language of the DBMS (e.g., SQL). Responses include completion codes, messages and results of queries.
  • 11. 11 What Does a DBMS Do? Now, how does a relational DBMS do these things? … • creates and destroys variables • updates variables (honouring constraints and authorisations) • takes note of integrity rules (constraints) • provides results of queries • takes note of authorisations (who is allowed to do what, to what) • and more In response to requests given by application programs:
  • 12. 12 Create and Destroy Variables VAR ENROLMENT BASE RELATION { StudentId SID , Name CHAR, CourseId CID } KEY { StudentId, CourseId } ; Creation (in Tutorial D): Destruction: DROP VAR ENROLMENT ;
  • 13. 13 Take Note of Integrity Rules CONSTRAINT MAX_ENROLMENTS COUNT ( ENROLMENT ) <= 20000 ; E.g., can’t have more than 20,000 enrolments altogether. In Tutorial D: And if a constraint ceases to be applicable: DROP CONSTRAINT MAX_ENROLMENTS ;
  • 14. 14 Take Note of Authorisations PERMISSION U9_ENROLMENT FOR User9 TO READ ENROLMENT ; E.g. (perhaps – but not in Tutorial D): Permissions sometimes need to be withdrawn: DROP PERMISSION U9_ENROLMENT ; PERMISSION U8_ENROLMENT FOR User8 TO UPDATE ENROLMENT ;
  • 15. 15 Updates Variables DELETE ENROLMENT WHERE StudentId = SID ( ‘S4’ ) ; E.g.: UPDATE ENROLMENT WHERE StudentId = SID ( ‘S1’ ) Name := ‘Ann’ ; INSERT ENROLMENT RELATION { TUPLE { StudentId SID ( ‘S4’ ) , Name ‘Devinder’ , CourseId CID ( ‘C1’ ) } } ;
  • 16. 16 Provides Results of Queries (ENROLMENT WHERE CourseId = CID(‘C1’)) { StudentId, Name } E.g.: Who is enrolled on course C1? The result is another relation! In tabular form: StudentId Name S1 Anne S2 Boris S4 Devinder
  • 17. 17 EXERCISE Consider this table: A B A 1 2 3 4 5 6 7 8 9 9 ? 1 2 3 Give three reasons why it cannot be representing a relation.
  • 18. 18 IMPORTANT BIT OF ADMIN Are you: (a) an overseas student visiting for just one year, or (b) doing a degree that is completely outside the CS department? (In which case you should complete an Unusual Option Form, obtainable from your dept secretary) If so, on exit from this lecture: Write your name, ITS userid, and course code on the sheet of paper provided. Otherwise you won’t get access to the software needed for the Worksheets!

Editor's Notes

  1. 10/01/2021
  2. 10/01/2021
  3. 10/01/2021
  4. 10/01/2021
  5. 10/01/2021
  6. 10/01/2021
  7. 10/01/2021
  8. 10/01/2021
  9. 10/01/2021
  10. 10/01/2021
  11. 10/01/2021
  12. 10/01/2021
  13. 10/01/2021
  14. 10/01/2021
  15. 10/01/2021
  16. 10/01/2021
  17. 10/01/2021
  18. 10/01/2021