SlideShare a Scribd company logo
1 of 18
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 (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.pptTHEFPS
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbmsAnjaan Gajendra
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramSiti Ismail
 
MIS201 SQL database .pdf
MIS201  SQL database .pdfMIS201  SQL database .pdf
MIS201 SQL database .pdfDrSalehAlSaleh
 
Conceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-modelsConceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-modelsShailaja 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.pptHemaSenthil5
 
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 designHemaSenthil5
 
introduction of database in DBMS
introduction of database in DBMSintroduction of database in DBMS
introduction of database in DBMSAbhishekRajpoot8
 
Chapter Seven- JDBC.pptx
Chapter Seven- JDBC.pptxChapter Seven- JDBC.pptx
Chapter Seven- JDBC.pptxBlenKassahun1
 
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-2013Prosanta 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 .docxDIPESH30
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsKuntal Bhowmick
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbmsAnjaan 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

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

Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
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
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
(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
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 

Recently uploaded (20)

Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
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
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
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
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(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...
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 

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